Conversation
|
@sobolevn Hello, is there anything more I can do to nudge this along? (I tried the re-request review button, it did nothing.) |
|
@Tinche Sorry, I am not a real mypy developer, I am just helping with what I can 🙂 |
|
@euresti Hello, might I kindly ask for your feedback here? |
|
@ilevkivskyi, can you give some advice on how to nudge this along? |
ilevkivskyi
left a comment
There was a problem hiding this comment.
TBH I didn't work on this for a while, but I don't see anything obviously wrong. I would however recommend adding a fine-grained daemon test, where you define a class, then update type of an attribute, and check that the change is propagated correctly to different file in fine-grained mode.
I will leave this for someone else to merge when the fine-grained test is added.
|
@ilevkivskyi thanks, added a fine-grained test. Hope I got it right! |
This PR further enhances the attrs plugin by generating a more correct
__attrs_attrs__field.The current version of the plugin generates this field as a tuple of attributes. This enhancement makes it a namedtuple, which is what attrs actually does in runtime. The difference is a large increase in the ergonomics of the field: instead of
A.__attrs_attrs__[0], a user can access an attribute usingA.__attrs_attrs__.x. Also note the end-users don't actually use the__attrs_attrs__field directly, but access it usingattr.fields, which is a very simple getter interface.This might sound like a trivial change, but it has big repercussions down the line for static checks in libraries building on top of attrs.
I have added 2 extra tests and improved an existing one.