is there any principle when writing python function

Neil Cerutti neilc at norwich.edu
Mon Aug 29 14:40:24 EDT 2011


On 2011-08-29, Chris Angelico <rosuav at gmail.com> wrote:
>> In my house, I'm dad. In my chorus, I'm Neil. In town I'm Neil
>> Cerutti, and in the global scope I have to use a meaningless
>> unique identifier. Hopefully no Python namespace ever gets that
>> big.
>
> Chorus? Does that imply that you sing? Neat :)

Wait... not all Python programmers sing?

> What you have, I think, is a module named Cerutti, in which you
> have a class of which Neil is an instance. Inside method
> functions, you can be referenced by "self" (which is to code
> what pronouns are to English); outside of them, you are
> referred to as Neil; and outside the module, Cerutti.Neil is
> the cleanest way to reference you. But your name is still Neil,
> no matter how you're referenced.

The problem with that scenario is that, in real life, there's
more than one Cerutti.Neil, and they like to move around. ;)

-- 
Neil Cerutti



More information about the Python-list mailing list