Re: What is a class method?

2010-08-24 Thread Jean-Michel Pichavant
Paulo da Silva wrote: Em 23-08-2010 04:30, James Mills escreveu: On Mon, Aug 23, 2010 at 12:49 PM, Paulo da Silva wrote: I understand the concept of a static method. However I don't know what is a class method. Would anybody pls. explain me? Please read this first:

Re: What is a class method?

2010-08-23 Thread Denis Gomes
John, I agree with you and I also think the definition given on the official python site is somewhat confusing, at least for an engineer like myself. But I'll take a stab at explaning it using what I know thus far. I think to understand what a class method is you have to first understand wha

Re: What is a class method?

2010-08-23 Thread Paulo da Silva
Em 23-08-2010 06:16, Ian Kelly escreveu: > On Sun, Aug 22, 2010 at 9:53 PM, Paulo da Silva > wrote: >> Em 23-08-2010 04:30, James Mills escreveu: >>> On Mon, Aug 23, 2010 at 12:49 PM, Paulo da Silva >>> wrote: >>>> I understand the concept of a static m

Re: What is a class method?

2010-08-22 Thread John Nagle
On 8/22/2010 9:16 PM, James Mills wrote: On Mon, Aug 23, 2010 at 1:53 PM, Paulo da Silva wrote: I did it before posting ... The "explanation" is not very clear. It is more like "how to use it". Without going into the semantics of languages basically the differences are quite clear: @classme

Re: What is a class method?

2010-08-22 Thread Terry Reedy
On 8/22/2010 11:53 PM, Paulo da Silva wrote: Please read this first: http://docs.python.org/library/functions.html#classmethod Then ask us questions :) I did it before posting ... When you ask a question, it help people answer if they know what you have already tried and failed with ;-)

Re: What is a class method?

2010-08-22 Thread Ian Kelly
On Sun, Aug 22, 2010 at 9:53 PM, Paulo da Silva wrote: > Em 23-08-2010 04:30, James Mills escreveu: >> On Mon, Aug 23, 2010 at 12:49 PM, Paulo da Silva >> wrote: >>> I understand the concept of a static method. >>> However I don't know what is a class met

Re: What is a class method?

2010-08-22 Thread James Mills
On Mon, Aug 23, 2010 at 1:53 PM, Paulo da Silva wrote: > I did it before posting ... > The "explanation" is not very clear. It is more like "how to use it". Without going into the semantics of languages basically the differences are quite clear: @classmethod is a decorator that warps a function

Re: What is a class method?

2010-08-22 Thread Paulo da Silva
Em 23-08-2010 04:30, James Mills escreveu: > On Mon, Aug 23, 2010 at 12:49 PM, Paulo da Silva > wrote: >> I understand the concept of a static method. >> However I don't know what is a class method. >> Would anybody pls. explain me? > > Please read this firs

Re: What is a class method?

2010-08-22 Thread James Mills
On Mon, Aug 23, 2010 at 12:49 PM, Paulo da Silva wrote: > I understand the concept of a static method. > However I don't know what is a class method. > Would anybody pls. explain me? Please read this first: http://docs.python.org/library/functions.html#classmethod Then as

What is a class method?

2010-08-22 Thread Paulo da Silva
I understand the concept of a static method. However I don't know what is a class method. Would anybody pls. explain me? class C: @classmethod def ... ... Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: What is a class?

2008-03-08 Thread Steven D'Aprano
On Sat, 08 Mar 2008 09:52:41 -0800, castironpi wrote: > On Mar 7, 6:16 am, Steven D'Aprano <[EMAIL PROTECTED] > cybersource.com.au> wrote: >> On Thu, 06 Mar 2008 08:40:47 -0800, castironpi wrote: >> > you >> > could say exec( open( 'modA.py' ).read() ) ==> import modA >> >> Yes, you could say that

Re: What is a class?

2008-03-08 Thread castironpi
On Mar 7, 6:16 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Thu, 06 Mar 2008 08:40:47 -0800, castironpi wrote: > > you > > could say exec( open( 'modA.py' ).read() ) ==> import modA > > Yes, you could say that, but you'd be wrong. Please test your code before > making such

Re: What is a class?

2008-03-07 Thread Steven D'Aprano
On Thu, 06 Mar 2008 08:40:47 -0800, castironpi wrote: > you > could say exec( open( 'modA.py' ).read() ) ==> import modA Yes, you could say that, but you'd be wrong. Please test your code before making such claims in the future. -- Steven -- http://mail.python.org/mailman/listinfo/python-li

Re: What is a class?

2008-03-06 Thread Gabriel Genellina
En Thu, 06 Mar 2008 14:40:47 -0200, <[EMAIL PROTECTED]> escribi�: > On Mar 6, 12:17 am, "Daniel Fetchinson" <[EMAIL PROTECTED]> > wrote: >> >> > What does exec( open( 'modA.py' ).read() ) do? >> > > A more appropriate formulation of the 'question behind the words' > would have been, 'are there any

Re: What is a class?

2008-03-06 Thread castironpi
On Mar 6, 1:03 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Mar 5, 7:50 pm, [EMAIL PROTECTED] wrote: > > > What is a class that is not a module? > > A class is a bag of stuff and a namespace :) > > J. A module is a bag of stuff and a nam

Re: What is a class?

2008-03-06 Thread [EMAIL PROTECTED]
On Mar 5, 7:50 pm, [EMAIL PROTECTED] wrote: > What is a class that is not a module? A class is a bag of stuff and a namespace :) J. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is a class?

2008-03-06 Thread castironpi
On Mar 6, 12:17 am, "Daniel Fetchinson" <[EMAIL PROTECTED]> wrote: > > > Where to begin? > > > What does exec( open( 'modA.py' ).read() ) do? > > The most appropriate list to ask those questions is: > > http://mail.python.org/mailman/listinfo/tutor Thanks for the reference. I'm basically experien

Re: What is a class?

2008-03-06 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > And white to play. What does exec( open( 'modA.py' ).read() ) do? RTFM -- http://mail.python.org/mailman/listinfo/python-list

Re: What is a class?

2008-03-05 Thread Daniel Fetchinson
> > Where to begin? > > What does exec( open( 'modA.py' ).read() ) do? The most appropriate list to ask those questions is: http://mail.python.org/mailman/listinfo/tutor -- http://mail.python.org/mailman/listinfo/python-list

Re: What is a class?

2008-03-05 Thread castironpi
On Mar 5, 8:06 pm, [EMAIL PROTECTED] wrote: > On Mar 5, 4:25 pm, Steven D'Aprano <[EMAIL PROTECTED] > > cybersource.com.au> wrote: > > On Wed, 05 Mar 2008 13:49:20 -0800, castironpi wrote: > > > Classes and modules are really similar.  In Python they're really > > > *really* similar. > > > Yes they

Re: What is a class?

2008-03-05 Thread castironpi
On Mar 5, 4:25 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Wed, 05 Mar 2008 13:49:20 -0800, castironpi wrote: > > Classes and modules are really similar.  In Python they're really > > *really* similar. > > Yes they are. > > Both are namespaces. The very last line of the Z

Re: What is a class?

2008-03-05 Thread Steven D'Aprano
On Wed, 05 Mar 2008 13:49:20 -0800, castironpi wrote: > Classes and modules are really similar. In Python they're really > *really* similar. Yes they are. Both are namespaces. The very last line of the Zen of Python says: >>> import this ... Namespaces are one honking great idea -- let's do mo

Re: What is a class?

2008-03-05 Thread castironpi
On Mar 5, 3:58 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Wed, 05 Mar 2008 10:50:12 -0800, castironpi wrote: > > What is a class that is not a module? > > Er, all of them? > > I'm curious what classes you think are modules. > &

Re: What is a class?

2008-03-05 Thread Paul McGuire
On Mar 5, 3:49 pm, [EMAIL PROTECTED] wrote: > > Classes and modules are really similar.  In Python they're really > *really* similar. > > Actually, at this point, that observation may have more of a > subjective component than I'm used to asserting.  I pause here for > corroboration and others' per

re: What is a class?

2008-03-05 Thread Michael Wieher
You import classes from modules. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is a class?

2008-03-05 Thread Steven D'Aprano
On Wed, 05 Mar 2008 10:50:12 -0800, castironpi wrote: > What is a class that is not a module? Er, all of them? I'm curious what classes you think are modules. -- Steven -- http://mail.python.org/mailman/listinfo/python-list

Re: What is a class?

2008-03-05 Thread castironpi
> > > > What is a class that is not a module? > > > I'm willing to address convention, in serial or parallel--- (change > > subject to 'what goes on newsgroups'?), but it's not clear from fact > > what assumption who has made. > > Si

Re: What is a class?

2008-03-05 Thread Mike Driscoll
On Mar 5, 12:50 pm, [EMAIL PROTECTED] wrote: > What is a class that is not a module? Why is a raven like a writing desk? As for Python class information, I would recommend reading the following sites: http://docs.python.org/tut/node11.html http://www.diveintopython.org/object_oriented_framew

Re: What is a class?

2008-03-05 Thread Paul McGuire
On Mar 5, 2:04 pm, [EMAIL PROTECTED] wrote: > On Mar 5, 1:29 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > > > On Mar 5, 12:50 pm, [EMAIL PROTECTED] wrote: > > > > What is a class that is not a module? > > > Please stop posting these one-liner beginner qu

Re: What is a class?

2008-03-05 Thread castironpi
On Mar 5, 1:29 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Mar 5, 12:50 pm, [EMAIL PROTECTED] wrote: > > > What is a class that is not a module? > > Please stop posting these one-liner beginner questions.  If you can > type it in one line, you can enter it on the Go

Re: What is a class?

2008-03-05 Thread Paul McGuire
On Mar 5, 12:50 pm, [EMAIL PROTECTED] wrote: > What is a class that is not a module? Please stop posting these one-liner beginner questions. If you can type it in one line, you can enter it on the Google.com or Ask.com query page and get a wealth of *existing* information, from tutori

What is a class?

2008-03-05 Thread castironpi
What is a class that is not a module? -- http://mail.python.org/mailman/listinfo/python-list