On Wed, 25 Jul 2007 00:55:17 +, Alex Popescu wrote:
> Neil Cerutti <[EMAIL PROTECTED]> wrote in news:eRwpi.36813$G23.28496
> @newsreading01.news.tds.net:
>
>> On 2007-07-25, Alex Popescu <[EMAIL PROTECTED]> wrote:
>>> As a matter of style, how do you figure out that class_list is
>>> a class
On Wed, 25 Jul 2007 00:22:18 +, Alex Popescu wrote:
> "Steven D'Aprano" <[EMAIL PROTECTED]> wrote in
> news:[EMAIL PROTECTED]:
>
>> On Tue, 24 Jul 2007 21:35:58 +, Alex Popescu wrote:
>>
>>> Neil Cerutti <[EMAIL PROTECTED]> wrote in
>>> news:[EMAIL PROTECTED]:
>>>
On 2007-07-24,
On 2007-07-25, Alex Popescu <[EMAIL PROTECTED]> wrote:
> Neil Cerutti <[EMAIL PROTECTED]> wrote in news:eRwpi.36813$G23.28496
> @newsreading01.news.tds.net:
>
>> On 2007-07-25, Alex Popescu <[EMAIL PROTECTED]> wrote:
>>> As a matter of style, how do you figure out that class_list is
>>> a class att
Alex Popescu a écrit :
> Bruno Desthuilliers <[EMAIL PROTECTED]> wrote
> in news:[EMAIL PROTECTED]:
>
>
>
>>[snip...]
>>
>>
>>Not necessarily - you can access class attributes from within an
>>instance method (but obviously a classmethod cannot access instance
>>attributes).
>>
>
> What I a
En Tue, 24 Jul 2007 21:55:17 -0300, Alex Popescu
<[EMAIL PROTECTED]> escribió:
> Neil Cerutti <[EMAIL PROTECTED]> wrote in news:eRwpi.36813$G23.28496
> @newsreading01.news.tds.net:
>> On 2007-07-25, Alex Popescu <[EMAIL PROTECTED]> wrote:
>>> As a matter of style, how do you figure out that clas
Neil Cerutti <[EMAIL PROTECTED]> wrote in news:eRwpi.36813$G23.28496
@newsreading01.news.tds.net:
> On 2007-07-25, Alex Popescu <[EMAIL PROTECTED]> wrote:
>> As a matter of style, how do you figure out that class_list is
>> a class attribute and not an instance attribute? (I don't
>> remember seei
On 2007-07-25, Alex Popescu <[EMAIL PROTECTED]> wrote:
> As a matter of style, how do you figure out that class_list is
> a class attribute and not an instance attribute? (I don't
> remember seeing anything in the PEP describing the coding
> style).
Check out dir(MyClass) and dir(MyClass()) for so
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
> On Tue, 24 Jul 2007 21:35:58 +, Alex Popescu wrote:
>
>> Neil Cerutti <[EMAIL PROTECTED]> wrote in
>> news:[EMAIL PROTECTED]:
>>
>>> On 2007-07-24, Alex Popescu <[EMAIL PROTECTED]> wrote:
Bruno Desthuilliers
On Tue, 24 Jul 2007 21:35:58 +, Alex Popescu wrote:
> Neil Cerutti <[EMAIL PROTECTED]> wrote in
> news:[EMAIL PROTECTED]:
>
>> On 2007-07-24, Alex Popescu <[EMAIL PROTECTED]> wrote:
>>> Bruno Desthuilliers <[EMAIL PROTECTED]>
>>> wrote in news:[EMAIL PROTECTED]:
>>>
>>
>> [snip...]
>>
>>>
>>
Neil Cerutti <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
> On 2007-07-24, Alex Popescu <[EMAIL PROTECTED]> wrote:
>> Bruno Desthuilliers <[EMAIL PROTECTED]>
>> wrote in news:[EMAIL PROTECTED]:
>>
>
> [snip...]
>
>>
>> class MyClass(object):
>> class_list = ['a', 'b']
>>
>> def instan
On 2007-07-24, Alex Popescu <[EMAIL PROTECTED]> wrote:
> Bruno Desthuilliers <[EMAIL PROTECTED]> wrote
> in news:[EMAIL PROTECTED]:
>
>
>>
>> [snip...]
>>
>>
>> Not necessarily - you can access class attributes from within an
>> instance method (but obviously a classmethod cannot access instance
james_027 a écrit :
> hi,
>
>> The 'real' use is (are) the one(s) you'll find. FWIW, I use
>> staticmethods for helper functions that don't need access to the class
>> or instance but are too specific to a class to be of any use as plain
>> functions. Which is not a very frequent case. Classmethod
hi,
> The 'real' use is (are) the one(s) you'll find. FWIW, I use
> staticmethods for helper functions that don't need access to the class
> or instance but are too specific to a class to be of any use as plain
> functions. Which is not a very frequent case. Classmethods are more
> usefull - mostl
From
> my understanding classmethod are for dealing with class attributes?
Not necessarily - you can access class attributes from within an
instance method (but obviously a classmethod cannot access instance
attributes).
> Can somebody teach me the real use of classmethod & staticmeth
On Tue, 24 Jul 2007 03:19:05 +, james_027 wrote:
> python's staticmethod is the equivalent of java staticmethod right?
Correct. `staticmethod` is essentially just a function moved into a class
and accessible at the class object and instances of that class.
As Python opposed to Java has func
nding classmethod are for dealing with class attributes?
Can somebody teach me the real use of classmethod & staticmethod?
Thanks
james
--
http://mail.python.org/mailman/listinfo/python-list
16 matches
Mail list logo