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

wesley chun wescpy at gmail.com
Mon Jun 30 11:34:50 CEST 2008

> Thanks for your reply (also thanks to others who replied). I was trying to
> translate a VBA sample in this page http://tinyurl.com/3hvj3j to python. The VBA
> sample has a line "Set objDbx = Nothing".


thanks for your reply... it helps clear things up -- i didn't think i
was going to extend your thread too much further beyond your original

anyhow, based on the piece of code that you were trying to translate,
i believe the Python version of the code will not require setting that
variable to None.  the reason is that the for-loop will automatically
change it to refer to another object.

> Btw, I bought your book "Core Python Programming, 2nd Edition" and really enjoy reading it. Thanks.

thanks for the kudos kelie! i'm glad that you're getting something out
of it!  pls be sure to visit the book's website to download the
Errata. most of the issues are minor but there are definitely more
critical ones to take note of as you're going thru it.

send us any more questions as they come up!

-- wesley
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"Core Python Programming", Prentice Hall, (c)2007,2001

wesley.j.chun :: wescpy-at-gmail.com
python training and technical consulting
cyberweb.consulting : silicon valley, ca

More information about the Tutor mailing list