[Edu-sig] python versus __python__

Arthur ajsiegel at optonline.net
Fri Oct 21 19:37:18 CEST 2005


Kirby Urner wrote:

>Going into my new presentation manager materials (perhaps using the same
>Pygame engine I used at OSCON, but as a general purpose module, i.e. not
>tied up in that specific content) is the distinction between two kinds of
>Python:  Python and __Python__.  
>  
>
The ego and the id of it...

is how I sometimes think of it.

>You really get to a new level with Python when you start using its
>underunder.  And that occurs, for many, right when they define a first class
>(or user type):  in the form of __init__.  __new__ comes even later (a
>paradox).
>  
>
Just posted to python-list on this, having found that subclassing 
numeric types is done at the __new__ level, not the __init__ level. 

I see __init__ as everyday waking consciousness, and __new__ inhabiting 
the netherworld.  But making the subconscious conscious leads to good 
mental health. Of which I am th strongest of advocates. And I am trying 
to dredge up __new__ to the conscious level.

>Another fissure defining beginner and advanced:  operator overloading.
>That's how it was in C++ books:  we'll get to that later.  Considered an
>advanced feature, not even featured in the original Java from Sun.
>  
>
This is something I felt comfortable exploring very early on - to the 
extent of having overused it.  I would hate to see you back-end that, as 
I think it is kind of fun to play with.  "let's change the boring old 
rules of math..." kind of thing.

I understand where you are going ,I think, but I would advocate being a 
bit less literal in finding the demarcation at  __xxx__.

You see properties as above ground, and everyday - I still see them as 
convenience for some once-in-a-while-necessary magic calls to __xxx__ 
fairies.

I think the dividing line has something more to do with the degree of 
introspection that one undertakes.

Deeper levels of introspection provokes one into a confrontation with 
one's Pythonic mortality ;)

Art




More information about the Edu-sig mailing list