On Tue, Sep 10, 2013 at 10:37 AM, Ramchandra Apte <[email protected]>wrote:
> On 10 September 2013 10:21, Anand Chitipothu <[email protected]> wrote: > > > On Tue, Sep 10, 2013 at 10:14 AM, Shabda Raaj <[email protected]> wrote: > > > > > This is a popular talk on quircks of ruby/js > > > > > > https://www.destroyallsoftware.com/talks/wat > > > > > > What are the quircks/unexpected behavior you find in Python? (Aka > Python > > > "wats"). > > > > > > > x = 10 > > > > class Foo: > > print x > > x = 0 > > print x > > del x > > print x > > > > # wat? > > _______________________________________________ > > BangPypers mailing list > > [email protected] > > https://mail.python.org/mailman/listinfo/bangpypers > > > > I fail to see how that is a "wat", it worked as I expected. (x is defined > in the the scope of Foo, then deleted, so then the last print x will > display 10) > Try replacing class Foo: with def foo(): and see what happens. Anand _______________________________________________ BangPypers mailing list [email protected] https://mail.python.org/mailman/listinfo/bangpypers
