Use cases for del

Ron Adam rrr at
Thu Jul 7 03:09:58 CEST 2005

Grant Edwards wrote:

> On 2005-07-06, Ron Adam <rrr at> wrote:
>>It would be a way to set an argument as being optional without actually 
>>assigning a value to it.  The conflict would be if there where a global 
>>with the name baz as well.  Probably it would be better to use a valid 
>>null value for what ever baz if for.  If it's a string then "", if its a 
>>number then 0, if it's a list then [], etc...
> Except those aren't "null values" for those types.  0 is a
> perfectly good integer value, and I use it quite often. There's
> a big difference between an "invalid integer value" and an
> integer with value 0.

Why would you want to use None as an integer value?

If a value isn't established yet, then do you need the name defined? 
Wouldn't it be better to wait until you need the name then give it a value?

More information about the Python-list mailing list