[BangPypers] Python "Wat"s

Anand B Pillai anandpillai at letterboxes.org
Tue Sep 10 08:08:59 CEST 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 10 September 2013 10:57 AM, Shabda Raaj wrote:
>> A variable is either local or global. It is decided at the
>> compile time.
> 
> Erm, compile?
> 
> 
> Python's scoping rules are , erm, interesting:
> 
> http://me.veekun.com/blog/2011/04/24/gotcha-python-scoping-closures/

Another
> 
one. Ability to modify builtin booleans.


>>> True,False=False,True True
False
>>> False
True
>>> if False: print 'OK'
..
OK

> 
> The mnemonic for scoping is LEGB: 
> http://stackoverflow.com/questions/291978/short-description-of-python-scoping-rules
>
> 
_______________________________________________
> BangPypers mailing list BangPypers at python.org 
> https://mail.python.org/mailman/listinfo/bangpypers
> 


- -- 
Regards,

- --Anand

-
--------------------------------------------------------------------------------------
Software Architect/Consultant
anandpillai at letterboxes.org

Please note my updated email address <anandpillai at letterboxes.org>.
Kindly update your address books.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSLrd7AAoJEMTxYeOp9eaoA1cIAK1dVtOXXyJICUsaFAiQA6CW
2w4OhQtbhvBvQcO2k39tt5vx8NXmipRmsBHTALKE7LOu/Vdo7Vj3RlkrQTtmJybM
i/q4uOLPu8Ubaba2Du4OTmYqSZkxQh/7lNN3pc4aoixygCppgetQbQ/7i5gUeNYK
x99RrtYzOn0P+p2JNhGuYZmMAFxkFAkqU9ajfu+0vaOI5ZpbfjqCLUTqZd7rTlfI
36Y451LyeCO+R3D14IIF9G/mRcUOAOPVrh0wcTIuTUtGdgGp8Z2Y8VvDin2n8lZ4
2JMDflfyZziUPFjcqQJCQrGA4I7CbYtHWT4daydn3o7icM9JtFqLAqDJfDnG5ew=
=aVB/
-----END PGP SIGNATURE-----


More information about the BangPypers mailing list