Default scope of variables
rosuav at gmail.com
Tue Jul 9 07:07:29 CEST 2013
On Tue, Jul 9, 2013 at 2:52 PM, alex23 <wuwei23 at gmail.com> wrote:
> with new_transaction(conn) as folder_tran:
> with folder_tran.subtransaction() as file_tran:
> with file_tran.subtransaction() as type_tran:
Warp my code around a language limitation? Only if I absolutely have to.
The subtransactions are NOT concepted as separate transactions. They
are effectively the database equivalent of a try/except block. Would
you want to have to use a different name for a builtin just because
you're inside a try block?
a = int("123")
b = int1(user_input)
b = 0
c = int("234")
No. That assignment to b should be int(), same as a and c.
More information about the Python-list