On Fri, Sep 14, 2012 at 4:43 AM, Ray Jones <crawlz...@gmail.com> wrote:
>
>         source = source.remove('')
>
> Between the two arrows, 'source' inexplicably switches from <type list>
> to <type NoneType>. Why?

    >>> x = [1,2,3]
    >>> result = x.remove(1)
    >>> type(result)
    <type 'NoneType'>
    >>> x
    [2, 3]

Methods that mutate an object typically return None. Just call
remove() without reassignment.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to