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 |
|
@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 |
|
@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: def main(a: type[int]) -> str:
type = str(a)
return type
print(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!