Re: [Tutor] 'object' class

2011-10-14 Thread Steven D'Aprano
Dave Angel wrote: 2) I believe super() is new to new-style classes. In any case the documentation for it seem to assume new-style. Yes, super() only works for new style classes. >>> class Test: ... def method(self): ... super(Test, self).method() ... >>> t = Test() >>> t.met

Re: [Tutor] 'object' class

2011-10-14 Thread Dave Angel
On 10/14/2011 10:17 AM, Rafael Durán Castañeda wrote: 2011/10/14 Max S. I have seen classes created with 'class Class_Name:' and 'class Class_Name(object):'. I'm using the latter, just in case it has some sort of method that could be useful that I don't know about, but *are *there any methods

Re: [Tutor] 'object' class

2011-10-14 Thread Rafael Durán Castañeda
2011/10/14 Max S. > I have seen classes created with 'class Class_Name:' and 'class > Class_Name(object):'. I'm using the latter, just in case it has some sort > of method that could be useful that I don't know about, but *are *there > any methods in the 'object' class? And if so, what are they

Re: [Tutor] Object/Class Beginner Questions

2011-01-14 Thread Ben Ganzfried
* I meant that*: A method actually can be called from the command prompt, but the syntax is quite different than that used to call a function from the command prompt. On Fri, Jan 14, 2011 at 2:37 PM, Ben Ganzfried wrote: > I actually just figured it out (since the tutorial talks about the > diffe

Re: [Tutor] Object/Class Beginner Questions

2011-01-14 Thread Ben Ganzfried
I actually just figured it out (since the tutorial talks about the difference in indentation between a method and a function in a later chapter). Basically, a method is within a class and therefore cannot be called from the command prompt whereas a function that stands by itself in a script can be

Re: [Tutor] Object/Class Beginner Questions

2011-01-14 Thread Steven D'Aprano
Ben Ganzfried wrote: Hey guys, I'm using a tutorial geared for a 2.x version of Python and I am currently using Python 3.1-- so it is possible that my confusion has to do with different notations between them. But in any case, here is what I have: My questions are the following: 1) Why is th

Re: [Tutor] Object/Class Beginner Questions

2011-01-14 Thread Alex Hall
On 1/14/11, Ben Ganzfried wrote: > Hey guys, > > I'm using a tutorial geared for a 2.x version of Python and I am currently > using Python 3.1-- so it is possible that my confusion has to do with > different notations between them. But in any case, here is what I have: > type(Time) > t