Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe our attrs usage in contributor guide #3116

Open
jakkdl opened this issue Oct 19, 2024 · 2 comments
Open

Describe our attrs usage in contributor guide #3116

jakkdl opened this issue Oct 19, 2024 · 2 comments

Comments

@jakkdl
Copy link
Member

jakkdl commented Oct 19, 2024

#3114 made me think that we should have a short blurb in the contributors guide on our attrs usage. I remember it being very confusing when I started contributing, and #3114 adds another pitfall (though thankfully with a test), and tbh I'm still not fully sure myself when to use what.

Possible content:

  1. why we use attrs in the first place(?)
  2. that we prefer underscored attribute names, with an alias (and why pyright makes the alias needed)
  3. when to use slots=False
  4. when to use eq=False
  5. when to use @frozen

The latter three are fairly common, but not universal, and I have a suspicion that we may not be fully consistent. Addressing the points could include pointing to official attrs docs, issues/PRs discussing pros/cons, or summarizing info that's happened in a lot of different places.

@Zac-HD
Copy link
Member

Zac-HD commented Oct 21, 2024

I just noticed that we've dropped the aliases from CancelScope, exactly because pyright started complaining when I updated Trio 😓

Maybe we should have a tiny flake8 plugin or grep command in CI to check for that? And we should also report it upstream to pyright, the best fix would be there.

@jakkdl
Copy link
Member Author

jakkdl commented Oct 21, 2024

I just noticed that we've dropped the aliases from CancelScope, exactly because pyright started complaining when I updated Trio 😓

Maybe we should have a tiny flake8 plugin or grep command in CI to check for that? And we should also report it upstream to pyright, the best fix would be there.

yeah that's #3114

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants