[Tutor] Is "var = None" in Python equivalent to "Set var

Tony Cappellini cappy2112 at gmail.com
Sun Jun 29 21:47:34 CEST 2008


Message: 9
Date: Sun, 29 Jun 2008 01:20:16 -0700
From: "wesley chun" <wescpy at gmail.com>
Subject: Re: [Tutor] Is "var = None" in Python equivalent to "Set var
       =       Nothing"in VB?
To: kf9150 at gmail.com, "Alan Gauld" <alan.gauld at btinternet.com>
Cc: tutor at python.org


>>the reason why i ask is because it's not standard practice i see
>>people doing this with Python,

Why? Since when is setting anything to None an outdated practice?
Does this mean checking an object to None is also outdated?

Setting it to None immediately puts the object in a state where the user
knows they need to
re-initialize it before using it again.

del will only reclaim that var at a later time, when the gc kicks in.

Of course, if that object won't be used again in the same scope, does it
really matter ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20080629/003e1d1e/attachment.htm>


More information about the Tutor mailing list