Medardo Rodriguez (Merchise Group) a écrit :
On Tue, Aug 26, 2008 at 4:10 PM, Bruno Desthuilliers
[EMAIL PROTECTED] wrote:
In Python, there's *no* relationship between classmethods and metaclasses.
In OOP the concept of meta-class has everything to do with class
methods, regardless if is in
MeTheGameMakingGuy a écrit :
On Aug 24, 6:32 pm, Hussein B [EMAIL PROTECTED] wrote:
Hi,
I'm familiar with static method concept, but what is the class method?
how it does differ from static method? when to use it?
--
class M:
def method(cls, x):
pass
method = classmethod(method)
--
Thank
Maric Michaud a écrit :
(snip)
It is a common advice that staticmethod should not exist in python, as they do
nothing compared to module level functions,
They do nothing more, but are accessible thru a class object instead
of being accessible thru a module object. It sometimes happens to be
Hussein B a écrit :
Hi,
I'm familiar with static method concept,
Which is more often than not useless in Python - we have true functions
and modules.
but what is the class method?
Short answer : It's a method that can be looked up upon both the class
or an instance of it, and takes
On Tue, Aug 26, 2008 at 4:10 PM, Bruno Desthuilliers
[EMAIL PROTECTED] wrote:
In Python, there's *no* relationship between classmethods and metaclasses.
In OOP the concept of meta-class has everything to do with class
methods, regardless if is in Python, SmallTalk or CLOSS. classmethod
decorator
On Aug 24, 5:32 am, Hussein B [EMAIL PROTECTED] wrote:
Hi,
I'm familiar with static method concept, but what is the class method?
how it does differ from static method? when to use it?
I use them when I need alternative constructors for a class.
class Angle(object):
def __init__(self
Medardo Rodriguez (Merchise Group) wrote:
On Tue, Aug 26, 2008 at 4:10 PM, Bruno Desthuilliers
[EMAIL PROTECTED] wrote:
In Python, there's *no* relationship between classmethods and metaclasses.
In OOP the concept of meta-class has everything to do with class
methods, regardless if is in
Steven D'Aprano [EMAIL PROTECTED] writes:
On Sun, 24 Aug 2008 11:09:46 +0200, Hrvoje Niksic wrote:
Use [classmethod] when your method needs to know what class it is
called from.
Ordinary methods know what class they are called from
I guess I should have added and no more. :-)
Why is
Hi,
I'm familiar with static method concept, but what is the class method?
how it does differ from static method? when to use it?
--
class M:
def method(cls, x):
pass
method = classmethod(method)
--
Thank you for your time.
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 24, 6:32 pm, Hussein B [EMAIL PROTECTED] wrote:
Hi,
I'm familiar with static method concept, but what is the class method?
how it does differ from static method? when to use it?
--
class M:
def method(cls, x):
pass
method = classmethod(method)
--
Thank you for your time
Hussein B [EMAIL PROTECTED] writes:
Hi,
I'm familiar with static method concept, but what is the class method?
how it does differ from static method? when to use it?
--
class M:
def method(cls, x):
pass
method = classmethod(method)
Use it when your method needs to know what class
On Aug 24, 3:35 am, MeTheGameMakingGuy [EMAIL PROTECTED]
wrote:
On Aug 24, 6:32 pm, Hussein B [EMAIL PROTECTED] wrote:
Hi,
I'm familiar with static method concept, but what is the class method?
how it does differ from static method? when to use it?
--
class M:
def method(cls, x
Le Sunday 24 August 2008 10:32:34 Hussein B, vous avez écrit :
Hi,
I'm familiar with static method concept, but what is the class method?
how it does differ from static method? when to use it?
--
class M:
def method(cls, x):
pass
method = classmethod(method)
As it has been said
On Sun, Aug 24, 2008 at 4:32 AM, Hussein B [EMAIL PROTECTED] wrote:
I'm familiar with static method concept, but what is the class method?
how it does differ from static method? when to use it?
Class Methods are related to the meta-class concept introduced since
the first beginning of OOP
On Sun, 24 Aug 2008 11:09:46 +0200, Hrvoje Niksic wrote:
Hussein B [EMAIL PROTECTED] writes:
Hi,
I'm familiar with static method concept, but what is the class method?
how it does differ from static method? when to use it? --
class M:
def method(cls, x):
pass
method = classmethod
15 matches
Mail list logo