[Tutor] (2.7.3) Inexplicable change of type

Ray Jones crawlzone at gmail.com
Fri Sep 14 11:13:45 CEST 2012


On 09/14/2012 02:07 AM, Steven D'Aprano wrote:
> On 14/09/12 18:43, Ray Jones wrote:
>
>> Between the two arrows, 'source' inexplicably switches from<type list>
>> to<type NoneType>. Why?
>
> source.remove('') does not do what you think it does. Checking the
> Fine Manual is always a good idea, or experimentation at the interactive
> interpreter:
[...]
> So source = source.remove(' ') replaces source with None instead of the
> list, which is then lost.
>
> By the way, at the interactive interpreter you can also say:
>
>
> help(list.remove)
>
> to read some documentation on the method.
>

I did use the help() on that, but I missed the 'in place' part. That
would explain things! :))

Thanks.


Ray


More information about the Tutor mailing list