On Jan 20, 2006, at 6:12 AM, Jonathan Ellis wrote:
Incidently, the PEP has been updated following a python-dev thread in
which Ian Bicking noted that "I personally prefer cls, there are some
who use klass, and I haven't see class_ used." The PEP now recommends
the use of cls.
fwiw, as i understand things the recommendation
is to use 'cls' for classmethods *only*, in the
first argument position where 'self' would appear
for a regular method. elsewhere, 'class_' is still
recommended.
from:
http://www.python.org/dev/summary/2005-12-01_2005-12-15.html
PEP 8 recommended appending an underscore rather than corrupted
spelling when a name conflicts with a reserved word e.g. class_ rather
than klass). Ian suggested that a specific recommendation for the
class argument to classmethods be made; out of cls, klass and class_
he preferred cls. He further suggested that, as self is not used
outside of the first argument of instance methods, whatever spelling
of the class argument is used should not be used elsewhere (e.g. cls
^^^
for the class argument, and class_ elsewhere). This was generally
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
accepted.
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users