Re: Style question: metaclass self vs cls?

2012-07-17 Thread Michele Simionato
The standard is to use `cls`. In the __new__ method you can use `mcl` or `meta`. -- http://mail.python.org/mailman/listinfo/python-list

Re: Style question: metaclass self vs cls?

2012-07-17 Thread Ian Kelly
On Tue, Jul 17, 2012 at 6:23 AM, Michele Simionato michele.simion...@gmail.com wrote: The standard is to use `cls`. In the __new__ method you can use `mcl` or `meta`. I've also seen `mcs` a fair amount. -- http://mail.python.org/mailman/listinfo/python-list

Re: Style question: metaclass self vs cls?

2012-07-17 Thread Ian Kelly
On Tue, Jul 17, 2012 at 12:10 AM, alex23 wuwe...@gmail.com wrote: On Jul 17, 1:29 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: Here's a style question for you: in a metaclass, what should I call the instance parameter of methods, cls or self? Maybe portmanteu it as

Re: Style question: metaclass self vs cls?

2012-07-17 Thread Steven D'Aprano
On Tue, 17 Jul 2012 05:23:22 -0700, Michele Simionato wrote: The standard is to use `cls`. In the __new__ method you can use `mcl` or `meta`. Thanks to everyone who answered. I think I will stick with meta and cls. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Style question: metaclass self vs cls?

2012-07-16 Thread Steven D'Aprano
Here's a style question for you: in a metaclass, what should I call the instance parameter of methods, cls or self? class ExampleMeta(type): def method(self, *args): ... I'm not quite sure if that feels right. On the one hand, self is the ExampleMeta instance alright... but on the other,

Re: Style question: metaclass self vs cls?

2012-07-16 Thread Terry Reedy
On 7/16/2012 11:29 AM, Steven D'Aprano wrote: Here's a style question for you: in a metaclass, what should I call the instance parameter of methods, cls or self? class ExampleMeta(type): def method(self, *args): ... I'm not quite sure if that feels right. On the one hand, self is the