You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, in Django, there's this QuerySet object with a lot of methods, and to properly support those methods we need two (and maybe more in the future) generic parameters.
With get_type_analyze_hook I can convert QuerySet[MyModel] into QuerySet[MyModel, MyModel], so in the code user don't need to think about number of generics. But in error messages, all those generics values are present, though they don't have any semantics, it's just implementation detail.
Or, for Field, I need to have two generic params, one for type of __set__, one for __get__, so they appear in error message as (CharField for example)
For example, in Django, there's this
QuerySet
object with a lot of methods, and to properly support those methods we need two (and maybe more in the future) generic parameters.With
get_type_analyze_hook
I can convertQuerySet[MyModel]
intoQuerySet[MyModel, MyModel]
, so in the code user don't need to think about number of generics. But in error messages, all those generics values are present, though they don't have any semantics, it's just implementation detail.Or, for
Field
, I need to have two generic params, one for type of__set__
, one for__get__
, so they appear in error message as (CharField
for example)None of this info makes any sense to users, so I want it to just be
django.db.models.fields.CharField
.This is monkeypatching version that works for one of the cases, should be simple enough to add hook for that,
I can make a PR, if you approve it as a viable feature.
The text was updated successfully, but these errors were encountered: