[Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

Steven D'Aprano steve+comp.lang.python at pearwood.info
Tue Dec 25 08:44:21 EST 2012


On 2012年12月24日 00:19:18 -0500, Dave Angel wrote:
> Nobody's going to be able to understand your code if you persist in
> using self in unpythonic ways. It's used as the first argument of a
> class method. Period.

To be pedantic, "self" is the conventional argument for *instance* 
methods, not class methods. For class methods, the conventional first 
argument is "cls", not "self".
-- 
Steven


More information about the Python-list mailing list

AltStyle によって変換されたページ (->オリジナル) /