Python Newbie

Chris Angelico rosuav at gmail.com
Sun Feb 24 16:44:20 EST 2013


On Mon, Feb 25, 2013 at 8:08 AM, Roy Smith <roy at panix.com> wrote:
> In article <mailman.2438.1361739512.2939.python-list at python.org>,
>  Chris Angelico <rosuav at gmail.com> wrote:
>
>> > no need to remember what's an object and what's not -- everything is an
>> > object

Careful on the citations - Ethan Furman said that, I just quoted him.

> Well, not quite everything.  If I write:
>
> if foo:
>    do_this()
>    and_this()
>
> the code block making up the body of the "if" statement is not an
> object.  In some languages, it is.

Maybe, but the code of an entire function *is*. Granted, it's not an
object that can be built up manually (at least, not that I know of),
and it offers only limited functionality (dis.dis, but not a lot
else), so really it could be seen as just an implementation detail of
the function object itself. But it's still an object.

ChrisA



More information about the Python-list mailing list