Re: new-style class or old-style class?

2012-09-26 Thread alex23
On Sep 27, 6:15 am, wxjmfa...@gmail.com wrote: > The interesting point or my question. > Why a Python beginner arrives here and should ask about this? Would you prefer that they'd instead make some kind of false assumption and then post endless screeds condemning it? -- http://mail.python.org/mai

Re: new-style class or old-style class?

2012-09-26 Thread wxjmfauth
Le mardi 25 septembre 2012 16:44:05 UTC+2, Jayden a écrit : > In learning Python, I found there are two types of classes? Which one are > widely used in new Python code? Is the new-style much better than old-style? > Thanks!! Use Python 3 and classes. --- The interesting point or my ques

Re: new-style class or old-style class?

2012-09-26 Thread Roy Smith
In article <2e8a9e88-9e7e-43f7-a070-ea9054e62...@googlegroups.com>, Jayden wrote: > In learning Python, I found there are two types of classes? Which one are > widely used in new Python code? Is the new-style much better than old-style? > Thanks!! If you're just learning Python 2.x, you might

Re: new-style class or old-style class?

2012-09-26 Thread Ramchandra Apte
On Tuesday, 25 September 2012 20:14:05 UTC+5:30, Jayden wrote: > In learning Python, I found there are two types of classes? Which one are > widely used in new Python code? Is the new-style much better than old-style? > Thanks!! Next time just Google your questions. :-) Good luck with Python --

Re: new-style class or old-style class?

2012-09-25 Thread Mark Lawrence
On 25/09/2012 17:20, Steven D'Aprano wrote: On Tue, 25 Sep 2012 07:44:04 -0700, Jayden wrote: In learning Python, I found there are two types of classes? Which one are widely used in new Python code? New-style classes. Is the new-style much better than old-style? Yes. Always use new-styl

Re: new-style class or old-style class?

2012-09-25 Thread Steven D'Aprano
On Tue, 25 Sep 2012 07:44:04 -0700, Jayden wrote: > In learning Python, I found there are two types of classes? Which one > are widely used in new Python code? New-style classes. > Is the new-style much better than old-style? Yes. Always use new-style classes, unless you have some specific re

Re: new-style class or old-style class?

2012-09-25 Thread Chris Angelico
On Wed, Sep 26, 2012 at 12:44 AM, Jayden wrote: > In learning Python, I found there are two types of classes? Which one are > widely used in new Python code? Is the new-style much better than old-style? > Thanks!! Definitely go with new-style. In Python 3, old-style classes aren't supported, an

Re: new-style class or old-style class?

2012-09-25 Thread Littlefield, Tyler
On 9/25/2012 8:44 AM, Jayden wrote: In learning Python, I found there are two types of classes? Which one are widely used in new Python code? Is the new-style much better than old-style? Thanks!! Perhaps this is useful: http://docs.python.org/reference/datamodel.html It's 3.3 I think. -- Ta

Re: new style class

2007-12-12 Thread Bruce Coram
Steven Regrettably I have to reply to your post because it misses the point of my initial post completely. I suggested that Eric Raymond's advice provided cover for people who were rude, hostile or arrogant. There are two obvious responses: his advice does not provide such cover or it does

Re: new style class

2007-12-08 Thread Steven D'Aprano
On Sat, 08 Dec 2007 23:14:44 +, Bruce Coram wrote: >> http://www.catb.org/~esr/faqs/smart-questions.html >> > Eric Raymond's advice on how to ask questions the smart way would seem > to provide an excuse for people with ego control problems to indulge > themselves at the expense of others.

Re: new style class

2007-12-08 Thread Bruce Coram
Aahz wrote: > In article <[EMAIL PROTECTED]>, > Nigel Rantor <[EMAIL PROTECTED]> wrote: > >> I think what Boris was being exceedingly unhelpful in saying was "why >> should it work when you're calling methods that do not exist" >> > > http://www.catb.org/~esr/faqs/smart-questions.html >

Re: new style class

2007-11-02 Thread Gabriel Genellina
En Fri, 02 Nov 2007 08:58:32 -0300, gert <[EMAIL PROTECTED]> escribió: > Could not one of you just say "@staticmethod" for once damnit :) Do we have to read your mind now? You miss-typed the method names the first time. You could equally have forgotten to type the 'self' parameter. Don't you

Re: new style class

2007-11-02 Thread Aahz
In article <[EMAIL PROTECTED]>, Nigel Rantor <[EMAIL PROTECTED]> wrote: > >I think what Boris was being exceedingly unhelpful in saying was "why >should it work when you're calling methods that do not exist" http://www.catb.org/~esr/faqs/smart-questions.html -- Aahz ([EMAIL PROTECTED])

Re: new style class

2007-11-02 Thread gert
On Nov 2, 4:04 pm, Boris Borcic <[EMAIL PROTECTED]> wrote: > gert wrote: > > Could not one of you just say "@staticmethod" for once damnit :) > > I did, did I not ? i am sorry, yes you did :) -- http://mail.python.org/mailman/listinfo/python-list

Re: new style class

2007-11-02 Thread Nigel Rantor
gert wrote: > Could not one of you just say "@staticmethod" for once damnit :) > why were you asking if you knew the answer? yeesh -- http://mail.python.org/mailman/listinfo/python-list

Re: new style class

2007-11-02 Thread Boris Borcic
gert wrote: > Could not one of you just say "@staticmethod" for once damnit :) > I did, did I not ? -- http://mail.python.org/mailman/listinfo/python-list

Re: new style class

2007-11-02 Thread Bjoern Schliessmann
Wildemar Wildenburger wrote: > Bjoern Schliessmann wrote: >> No, since everyone's crystal balls are in repair. > > I don't even have crystal balls! Not many are rich *and* impotent. :) Regards, Björn -- BOFH excuse #14: sounds like a Windows problem, try calling Microsoft support -- http

Re: new style class

2007-11-02 Thread gert
On Nov 2, 2:10 pm, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > Bjoern Schliessmann wrote: > > gert wrote: > >> Could not one of you just say "@staticmethod" for once damnit :) > > > No, since everyone's crystal balls are in repair. > > I don't even have crystal balls! > > /W lol -- http:/

Re: new style class

2007-11-02 Thread Wildemar Wildenburger
Bjoern Schliessmann wrote: > gert wrote: >> Could not one of you just say "@staticmethod" for once damnit :) > > No, since everyone's crystal balls are in repair. > I don't even have crystal balls! /W -- http://mail.python.org/mailman/listinfo/python-list

Re: new style class

2007-11-02 Thread Bjoern Schliessmann
gert wrote: > oops the code is like this but doesn't work For sake of the god of your choice, please always provide runnable code as well as hints to - what you think it should do - what you want it to do - what exact error message(s) you get NOT just "it doesn't work". Regards, Björn --

Re: new style class

2007-11-02 Thread Bjoern Schliessmann
gert wrote: > Could not one of you just say "@staticmethod" for once damnit :) No, since everyone's crystal balls are in repair. Regards, Björn -- BOFH excuse #256: You need to install an RTFM interface. -- http://mail.python.org/mailman/listinfo/python-list

Re: new style class

2007-11-02 Thread gert
Could not one of you just say "@staticmethod" for once damnit :) -- http://mail.python.org/mailman/listinfo/python-list

Re: new style class

2007-11-02 Thread Nigel Rantor
gert wrote: > On Nov 2, 12:27 pm, Boris Borcic <[EMAIL PROTECTED]> wrote: >> gert wrote: >>> class Test(object): >>> def execute(self,v): >>> return v >>> def escape(v): >>> return v >>> if __name__ == '__main__': >>> gert = Test() >>> print gert.m1('1') >>> pri

Re: new style class

2007-11-02 Thread Boris Borcic
gert wrote: [...] Why doesn't this new style class work in python 2.5.1 ? >>> why should it ? >> I don't know I thought it was supported from 2.2? > > oops the code is like this but doesn't work > > class Test(object): > > def m1(self,v): > return v > > def m2(v): >

Re: new style class

2007-11-02 Thread Wildemar Wildenburger
gert wrote: > oops the code is like this but doesn't work > > class Test(object): > > def m1(self,v): > return v > > def m2(v): > return v > > if __name__ == '__main__': > gert = Test() > print gert.m1('1') > print Test.m2('2') > Well, what do you think:

Re: new style class

2007-11-02 Thread Martin Sand Christensen
> "gert" == gert <[EMAIL PROTECTED]> writes: gert> Why doesn't this new style class work in python 2.5.1 ? Whether you declare your class as a new style class or an old style class, your code is completely and utterly broken. Calling non-existing methods has never been a good way of getting t

Re: new style class

2007-11-02 Thread Tim Chase
gert wrote: > On Nov 2, 12:27 pm, Boris Borcic <[EMAIL PROTECTED]> wrote: >> gert wrote: >>> class Test(object): >>> def execute(self,v): >>> return v >>> def escape(v): >>> return v >>> if __name__ == '__main__': >>> gert = Test() >>> print gert.m1('1') >>> pri

Re: new style class

2007-11-02 Thread Wildemar Wildenburger
gert wrote: > On Nov 2, 12:27 pm, Boris Borcic <[EMAIL PROTECTED]> wrote: >> gert wrote: >>> class Test(object): >>> def execute(self,v): >>> return v >>> def escape(v): >>> return v >>> if __name__ == '__main__': >>> gert = Test() >>> print gert.m1('1') >>> pri

Re: new style class

2007-11-02 Thread gert
On Nov 2, 12:31 pm, gert <[EMAIL PROTECTED]> wrote: > On Nov 2, 12:27 pm, Boris Borcic <[EMAIL PROTECTED]> wrote: > > > > > gert wrote: > > > class Test(object): > > > > def execute(self,v): > > > return v > > > > def escape(v): > > > return v > > > > if __name__ == '__main

Re: new style class

2007-11-02 Thread gert
On Nov 2, 12:27 pm, Boris Borcic <[EMAIL PROTECTED]> wrote: > gert wrote: > > class Test(object): > > > def execute(self,v): > > return v > > > def escape(v): > > return v > > > if __name__ == '__main__': > > gert = Test() > > print gert.m1('1') > > print Test.m

Re: new style class

2007-11-02 Thread Boris Borcic
gert wrote: > class Test(object): > > def execute(self,v): > return v > > def escape(v): > return v > > if __name__ == '__main__': > gert = Test() > print gert.m1('1') > print Test.m2('2') > > Why doesn't this new style class work in python 2.5.1 ? > why s