None

Werner Schiendl ws-news at gmx.at
Tue Oct 30 09:37:59 CET 2001


"Greg Ewing" <greg at cosc.canterbury.ac.nz> wrote in message
news:3BDE19B0.586BC0A5 at cosc.canterbury.ac.nz...
> Werner Schiendl wrote:
> >
> > Assigning to None, however, seems more likely to happen e. g. if someone
> > tries to drop some unwanted return values there:
> >
> > a, None, b = function1()
>
> I don't really understand what leads people to do
> that. I mean, in C you wouldn't think to write
>
>   NULL = printf("Hi!\n");
>
> to discard the result of something, would you?
>
> In other words, if even if someone is under the
> misapprehension that None is a constant, that
> doesn't explain why they should think they can
> assign to it.

This is of course true. I think the idea can primarily come up because you
can get more than one return value from a function in python. (Although
technically, of course, it is just one tuple). This is not possible in C.

regards
Werner






More information about the Python-list mailing list