Uh oh!
There was an error while loading. Please reload this page.
Conversation
# Conflicts: # pdm.lock
@dbanty I was curious about the need to translate
I think the generated client would be easier to use if we kept fields named Edit: Oh, I see you are using the If this really must be done, I'd personally advocate for using the old |
eli-bl
commented
Dec 11, 2024
@johnthagen I may be off base but I think the issue may not be specifically the presence of a class attribute with that name, but instead, the fact that the generated If that is the issue... I think everyone would agree that moving away from that local-variable-naming scheme would be helpful, but it's non-trivial due to the way template macros are being used (at least in the case of |
dbanty
commented
Dec 11, 2024
@eli-bl is correct. The better solution would be to change the local variable naming, but it's a much bigger change. Sticking with
|
Yeah, Python supports shadowing at all levels, so locals will shadow built-ins within the scope they are declared. Shadowing typically makes this not a problem (otherwise lots of builtin names would need to be avoided). A trivial example: defmain(a: type[int]) ->str:
type=str(a)
returntypeprint(main(int))
# prints: <class 'int'> |
Now that 3.8 is EoL, we can finally update to use 3.9's generic syntax! --------- Co-authored-by: Dylan Anthony <dbanty@users.noreply.github.com>
Now that 3.8 is EoL, we can finally update to use 3.9's generic syntax!