Paul Garner
Paul Garner
FWIW... Parsy (parser combinator library) has a way of mimicking `do` notation using generators and yield expressions: https://parsy.readthedocs.io/en/latest/ref/generating.html#motivation-and-examples their example: ```python @generate("form") def form(): yield lparen exprs = yield expr.many()...
I am curious, I didn't fully understand the typing issue with generators+yield expressions.... and this looks like a generator expression as an argument to a function. Does it not have...
``` mypy==0.812 djangorestframework-stubs==1.4.0 ``` ```python users = serializers.ListSerializer( required=True, child=serializers.IntegerField() ) ``` mypy complains: ``` serializers.py:56:13: error: Need type annotation for 'users' [var-annotated] users = drf_serializers.ListSerializer( ^ ``` I was...
``` myproject/models/auth.py:19: error: Definition of "_meta" in base class "PermissionsMixin" is incompatible with definition in base class "AbstractBaseUser" myproject/models/auth.py:111: note: Revealed type is 'def (*args: Any, **kwargs: Any) -> myproject.models.auth.AuthUser'...
importing the same class as `from django.contrib.auth.base_user import AbstractBaseUser` does not make a difference in the mypy error we couldn't use `AbstractUser` as it defines stuff we don't want
```python if TYPE_CHECKING: reveal_type(AuthUser._meta) reveal_type(PermissionsMixin._meta) reveal_type(AbstractBaseUser._meta) ``` ``` myproject/models/auth.py:111: note: Revealed type is 'django.db.models.options.Options[django.contrib.auth.models.PermissionsMixin]' myproject/models/auth.py:112: note: Revealed type is 'django.db.models.options.Options[django.contrib.auth.models.PermissionsMixin]' myproject/models/auth.py:113: note: Revealed type is 'django.db.models.options.Options[django.contrib.auth.base_user.AbstractBaseUser]' ```
if you have a branch with the contravariant change at some point I'll be happy to try it out on my problem Django project
@kszmigiel I'm not saying it's not somehow... but it's not clear to me if that issue (about overriding _fields_ of abstract models in multiple inheritance scenario) is related to this...
personally right now I'm interested in #1575 use case (auto-adding an attribute to child model instances which links to the parent model instance) and don't care much about context-aware serialization...
I have exact same problem with `sqlalchemy[asyncio]` and missing `greenlet` dependency, Poetry on M1