On 02/24/2013 04:44 PM, Chris Angelico wrote:
On Mon, Feb 25, 2013 at 8:08  AM, Roy Smith <r...@panix.com> wrote:
>> In article <mailman.2438.1361739512.2939.python-l...@python.org>,
>> Chris Angelico <ros...@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


But if block doesn't have to be inside a function, right? It needs
to be inside a module, but then again everything is inside a module, but
it wouldn't be very object-oriented if the module was the only object in
Python :-).

 -m


--
Lark's Tongue Guide to Python: http://lightbird.net/larks/

The press, the machine, the railway, the telegraph are premises whose
thousand-year conclusion no one has yet dared to draw.  Friedrich Nietzsche

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to