Sigurd Ljødal
Sigurd Ljødal
> This seems like significant complexity to dynamically update the signature of just one function. > > There are lots more places in Django that depend on `AUTH_USER_MODEL`. Are you...
I'm not exactly sure if I'm following how you'd envision that working? Altering the type of `settings.AUTH_USER_MODEL` to be a type alias? Wouldn't that cause issues when directly accessing that...
One immediate problem I see with that is that `settings.USER_AUTH_MODEL` should stay defined as a string, as someone might rely on that at runtime as well. I guess `get_user_model()` is...
Hmm, wouldn't that break usage of the stubs without the plugin? For this to work properly I'd think it has to be defined somewhere in the stubs at least?
Hmm, interesting. Sounds like it's worth a try! Maybe best to try in a separate PR though?
Are we sure we can't just use `get_auth_user()` together with `get_dynamic_class_hook()` though? Something like this? ```python # stubs.pyi User = get_auth_user() class HttpRequest: user: User | AnonymousUser ```
But can't we change that using `get_dynamic_class_hook`?
I think I managed to make it work: #1730 Main trick was replacing the symbol with a placeholder when deferring, as otherwise the variable error popped up (that seems like...
I'm not entirely sure why, but I seem to be threading a very thin line between this working and getting infinite recursion due to deferring. Not entirely sure what, if...
Hmm, damnit, this ends up with `INTERNAL ERROR: maximum semantic analysis iteration count reached` when running it on our codebase. So even though all is green, it doesn't seem like...