It may not be a good idea to name a variable after a reserved word, but I am curious:
Is there any escape syntax in Python to allow you to use a reserved word as the name of a variable?
For example, in C# this can be done by prefixing the reserved word with @
It is not possible, however it is some kind of a tradition in Python to append a _
to get a new identifier:
def drive(from_, to):
pass
db.call( ..., **{ 'from' : date_from }, **{ 'to' : date_to })
Python doesn't do those check when unpacking.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With