Larry H.
Posts: 3
Nickname: larzluv
Registered: Sep, 2007
|
|
Re: Python 3K or Python 2.9?
|
Posted: Sep 26, 2007 4:28 AM
|
|
Thanks for the reply, Ian.
I'd suspected the "doesn't stand out enough" was a major reason. I'd thought about it myself. *Syntactically*, I find ".attribute" good, but *visually*... :/ :>
I like the "~.attribute" concept. I'd noted someone earlier mentioned they often use an underscore ("_.attribute"/"( _, param...)"); I'd neglected to notice this was even valid. (Finding this concept dubious, I even tried it out - worked fine! ;)
Either way, the "so much typing" is less of a gripe.
I still have an issue with the explicit self; to me, though obviously (*REPEATEDLY*! ;) not to the BDFL, it seems un-pythonic in my book.
That it's in the signature makes sense. (And allows one the freedom/flexibility to use any identifier one wishes, though "self" is de facto.) The parent object is being passed to our method.
Okay, fine.
But this is via "magic", and is one of those points that has to be "learnt" in Python. Every py-book, regardless of level, has taken time to make this point, and to try to "sell" the concept. Obviously, if it's non-obvious, perhaps it is "broke"?
Further, I'd find a "magical" special name, like "__self__". (Though I think "__inst__"/"__instance__" would be more correct, as "__self__" should, to my mind, be an object handle for the item in question, like the method/function; haven't though of a creative class variable to refer to the owner class, and "__class__" refers to the item in question.)
At any rate, thanks again, and, as always, just my $0.05. (Inflation, don'tcha-know!? ;)
-Larry
|
|