David Euresti

Results 37 comments of David Euresti

Yeah so the problem is that `attr.ib` wants the arguments to match and it uses the type of `default` (i.e. -1) as a higher precedence. So mypy says great ```...

This particular issue is stubs related which are part of attrs. (That's all the .pyi files in the codebase). There is also a plugin which lives in mypy for testability...

If I can add another wrench to this. Remember that issue with resolving the types that have strings in them? #265 This would be necessary for any kind of automatic...

You can very easily add `= None` to the class definition. Also default args don't play nice if they are in the middle. e.g. ``` @attr.s(auto_attribs=True) class Book: name: str...

This is interesting. Similar to an idea I had for supporting this in https://github.com/python/mypy/issues/5406#issuecomment-409233479 I wonder if this could be used in mypy itself. Might be complicated with all the...

How does it work with the overloads? Do you only annotate the real implementation? Can these be put in a .pyi file?

Yeah this is the same bug. Converters are extremely hard to handle. :)

Don't forget that annotations could be strings too. And in Python 3.10 will **always** be strings. And so not only do you have to evaluate them, you might also have...

Like this? ``` import attr from attr import NOTHING, attrib from typing import TypeVar from attr._make import _get_annotations, _CountingAttr, _is_class_var _C = TypeVar("_C", bound=type) def make_auto_attribs(cls: _C) -> _C: for...