Re: What is the semantics meaning of 'object'?

2013-06-29 Thread Mark Janssen
> On 26/06/2013 9:19 AM, Mark Janssen wrote: >> >> Did you ever hear of the Glass Bead Game? > > Which was Hesse's condemnation of the > pure-academic-understanding-unbound-by-pragmatic-use approach as mental > masturbation, It was not. He was conflicted. On the one hand he knew the enterprise w

Re: What is the semantics meaning of 'object'?

2013-06-27 Thread alex23
On 26/06/2013 9:19 AM, Mark Janssen wrote: Did you ever hear of the Glass Bead Game? Which was Hesse's condemnation of the pure-academic-understanding-unbound-by-pragmatic-use approach as mental masturbation, _not_ a recommendation for how human knowledge should work. If you think otherwise,

Re: What is the semantics meaning of 'object'?

2013-06-26 Thread Ethan Furman
On 06/26/2013 04:54 PM, Steven D'Aprano wrote: On Wed, 26 Jun 2013 13:14:44 -0700, Ethan Furman wrote: On 06/23/2013 11:50 AM, Steven D'Aprano wrote: What else would you call a function that does lookups on the current object's superclasses? Well, I would call it super(). Trouble is, that

Re: What is the semantics meaning of 'object'?

2013-06-26 Thread Ian Kelly
On Wed, Jun 26, 2013 at 5:54 PM, Steven D'Aprano wrote: > No. But "the current object" is not Base1, but an instance of Derived, > and Base2 *is* an ancestor of Derived. Perhaps if I had said "self" > instead of current object, you wouldn't have made this error. If so, I > apologise for confusing

Re: What is the semantics meaning of 'object'?

2013-06-26 Thread Steven D'Aprano
On Wed, 26 Jun 2013 13:14:44 -0700, Ethan Furman wrote: > On 06/23/2013 11:50 AM, Steven D'Aprano wrote: >> What else would you call a function that does lookups on the current >> object's superclasses? > > Well, I would call it super(). Trouble is, that is not all that super() > does. Going b

Re: What is the semantics meaning of 'object'?

2013-06-26 Thread Ethan Furman
On 06/23/2013 11:50 AM, Steven D'Aprano wrote: On Sun, 23 Jun 2013 12:04:35 -0600, Ian Kelly wrote: On Sun, Jun 23, 2013 at 11:36 AM, Steven D'Aprano wrote: On Sun, 23 Jun 2013 11:18:41 -0600, Ian Kelly wrote: Incidentally, although super() is useful, it's not perfect, and this is one of my

Re: What is the semantics meaning of 'object'?

2013-06-26 Thread Ethan Furman
On 06/23/2013 12:05 PM, Ian Kelly wrote: On Sun, Jun 23, 2013 at 12:46 PM, Steven D'Aprano wrote: All is not lost, there are ways to make your classes cooperative. The trick is to have your classes' __init__ methods ignore keyword arguments they don't know what to do with. object used to do the

Re: What is the semantics meaning of 'object'?

2013-06-26 Thread Chris Angelico
On Thu, Jun 27, 2013 at 1:16 AM, Rotwang wrote: > On 25/06/2013 23:57, Chris Angelico wrote: >> >> On Wed, Jun 26, 2013 at 8:38 AM, Mark Janssen >> wrote: >>> >>> Combining integers with sets I can make >>> a Rational class and have infinite-precision arithmetic, for example. >> >> >> Combining t

Re: What is the semantics meaning of 'object'?

2013-06-26 Thread Rotwang
On 25/06/2013 23:57, Chris Angelico wrote: On Wed, Jun 26, 2013 at 8:38 AM, Mark Janssen wrote: Combining integers with sets I can make a Rational class and have infinite-precision arithmetic, for example. Combining two integers lets you make a Rational. Python integers are already infinite-p

Re: What is the semantics meaning of 'object'?

2013-06-26 Thread Antoon Pardon
Op 26-06-13 00:27, Mark Janssen schreef: >> The main problem is getting to the top/end of the call chain. Classic >> example is with __init__, but the same problem can also happen with >> other calls. Just a crazy theory, but would it be possible to >> construct a black-holing object that, for any

Re: What is the semantics meaning of 'object'?

2013-06-26 Thread Chris Angelico
On Wed, Jun 26, 2013 at 9:19 AM, Mark Janssen wrote: > Did you ever hear of the Glass Bead Game? Yeah, it's Magic: The Gathering and its counters. http://www.wizards.com/magic/magazine/Article.aspx?x=mtgcom/daily/mr195 :) ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the semantics meaning of 'object'?

2013-06-26 Thread Ian Kelly
On Tue, Jun 25, 2013 at 7:07 PM, Mark Janssen wrote: >> When you inherit a "set" to make a Rational, you're making the >> statement (to the interpreter, if nothing else) that a Rational is-a >> set. > > No you don't *inherit* a set to make a Rational, although you gain a > set to make it. Okay, t

Re: What is the semantics meaning of 'object'?

2013-06-26 Thread Steven D'Aprano
On Tue, 25 Jun 2013 16:19:08 -0700, Mark Janssen wrote: > Well you've been spoiled by all the work that came before you. The > issue now is not to go "back to the machine" so much as to tear down and > build up again from raw materials, objects of more and more complexity > where very complex "me

Re: What is the semantics meaning of 'object'?

2013-06-26 Thread Chris Angelico
On Wed, Jun 26, 2013 at 11:07 AM, Mark Janssen wrote: Combining two integers lets you make a Rational. >>> >>> Ah, but what is going to group them together? You see you've already >>> gotten seduced. Python already uses a set to group them together -- >>> it's called a Dict and it's in ever

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Mark Janssen
>>> Combining two integers lets you make a Rational. >> >> Ah, but what is going to group them together? You see you've already >> gotten seduced. Python already uses a set to group them together -- >> it's called a Dict and it's in every Class object. > > When you inherit a "set" to make a Ratio

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Ian Kelly
On Tue, Jun 25, 2013 at 5:19 PM, Mark Janssen wrote: >>> Combining integers with sets I can make >>> a Rational class and have infinite-precision arithmetic, for example. >> >> Combining two integers lets you make a Rational. > > Ah, but what is going to group them together? You see you've alread

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Mark Janssen
>> Here's how it *should* be made: the most superest, most badassed >> object should take care of its children. New instances should >> automatically call up the super chain (and not leave it up to the >> subclasses), so that the parent classes can take care of the chil'en. >> When something goe

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Mark Janssen
>> Combining integers with sets I can make >> a Rational class and have infinite-precision arithmetic, for example. > > Combining two integers lets you make a Rational. Ah, but what is going to group them together? You see you've already gotten seduced. Python already uses a set to group them to

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Ian Kelly
On Tue, Jun 25, 2013 at 5:07 PM, Ian Kelly wrote: > On Tue, Jun 25, 2013 at 4:38 PM, Mark Janssen > wrote: >> The issue of classes cooperating isn't as big as it seems, because >> since you're working now from a useful, agreed-upon common base (the >> non-negotiable, but also non-arbitrary) mach

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Ian Kelly
On Tue, Jun 25, 2013 at 4:38 PM, Mark Janssen wrote: > Sorry my last message got sent prematurely. Retrying... > >> So instead of super(), you would have sub()? It's an interesting >> concept, but I don't think it changes anything. You still have to >> design your classes cooperatively if you e

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Chris Angelico
On Wed, Jun 26, 2013 at 9:00 AM, Mark Janssen wrote: >> 1) That breaks the Liskov Substitution Principle. A subclass of list >> ought to fulfill the contracts of a basic list. > > We don't need LSP. I write about this on the WIkiWikiWeb where there > were many arguments documented and many hairs

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Chris Angelico
On Wed, Jun 26, 2013 at 8:38 AM, Mark Janssen wrote: > Combining integers with sets I can make > a Rational class and have infinite-precision arithmetic, for example. Combining two integers lets you make a Rational. Python integers are already infinite-precision. Or are you actually talking of us

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Chris Angelico
On Wed, Jun 26, 2013 at 8:27 AM, Mark Janssen wrote: > Here's how it *should* be made: the most superest, most badassed > object should take care of its children. New instances should > automatically call up the super chain (and not leave it up to the > subclasses), so that the parent classes ca

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Chris Angelico
On Wed, Jun 26, 2013 at 8:25 AM, Ian Kelly wrote: > On Tue, Jun 25, 2013 at 4:17 PM, Chris Angelico wrote: >> The main problem is getting to the top/end of the call chain. Classic >> example is with __init__, but the same problem can also happen with >> other calls. Just a crazy theory, but would

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Mark Janssen
Sorry my last message got sent prematurely. Retrying... > So instead of super(), you would have sub()? It's an interesting > concept, but I don't think it changes anything. You still have to > design your classes cooperatively if you expect to use them with > multiple inheritance. Yes, and let

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Mark Janssen
> The main problem is getting to the top/end of the call chain. Classic > example is with __init__, but the same problem can also happen with > other calls. Just a crazy theory, but would it be possible to > construct a black-holing object that, for any given method name, > returns a dummy function

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Mark Janssen
> So instead of super(), you would have sub()? It's an interesting > concept, but I don't think it changes anything. You still have to > design your classes cooperatively if you expect to use them with > multiple inheritance. Yes, and let new instances of the child classes automatically ensure t

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Ian Kelly
On Tue, Jun 25, 2013 at 4:17 PM, Chris Angelico wrote: > The main problem is getting to the top/end of the call chain. Classic > example is with __init__, but the same problem can also happen with > other calls. Just a crazy theory, but would it be possible to > construct a black-holing object tha

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Ian Kelly
On Tue, Jun 25, 2013 at 3:58 PM, Mark Janssen wrote: > Ah, and here we see the weakness in the object architecture that has > evolved in the past decade (not just in Python, note). It hasn't > really ironed out what end is what. Here's a proposal: the highest, > most "parental", most general o

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Chris Angelico
On Wed, Jun 26, 2013 at 3:44 AM, Ian Kelly wrote: > On Sun, Jun 23, 2013 at 1:33 PM, Antoon Pardon > wrote: >> Op 23-06-13 18:35, Steven D'Aprano schreef: >>> Please don't. This is false economy. The time you save will be trivial, >>> the overhead of inheritance is not going to be the bottleneck

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Mark Janssen
> This bothers me as well. If you look at Raymond Hettinger's "super() > considered super" article, he includes the (correct) advice that > super() needs to be used at every level of the call chain. At the end > of the article, he offers this example to show how "easy" multiple > inheritance can

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Ian Kelly
On Sun, Jun 23, 2013 at 1:33 PM, Antoon Pardon wrote: > Op 23-06-13 18:35, Steven D'Aprano schreef: >> Please don't. This is false economy. The time you save will be trivial, >> the overhead of inheritance is not going to be the bottleneck in your >> code, and by ignoring super, you only accomplis

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Antoon Pardon
Op 23-06-13 18:35, Steven D'Aprano schreef: On Sun, 23 Jun 2013 10:15:38 -0600, Ian Kelly wrote: If you're worried about efficiency, you can also explicitly name the superclass in order to call the method directly, like: A.__init__(self, arg) Please don't. This is false economy. The

Re: What is the semantics meaning of 'object'?

2013-06-24 Thread Steven D'Aprano
On Mon, 24 Jun 2013 08:58:23 -0700, Mark Janssen wrote: >>> Mostly I'm saying that super() is badly named. >> >> What else would you call a function that does lookups on the current >> object's superclasses? > > ^. You make a symbol for it. ^__init__(foo, bar) If you want Perl, you can find it

Re: What is the semantics meaning of 'object'?

2013-06-24 Thread Ian Kelly
On Mon, Jun 24, 2013 at 9:58 AM, Mark Janssen wrote: >>> Mostly I'm saying that super() is badly named. >> >> What else would you call a function that does lookups on the current >> object's superclasses? > > ^. You make a symbol for it. ^__init__(foo, bar) On the one hand, eww. On the other h

Re: What is the semantics meaning of 'object'?

2013-06-24 Thread Ian Kelly
On Mon, Jun 24, 2013 at 9:00 AM, Rotwang wrote: > On 24/06/2013 07:31, Steven D'Aprano wrote: > >> I daresay that there are good reasons why new-style classes don't do the >> same thing, but the point is that had the Python devs had been >> sufficiently interested in keeping the old behaviour, and

Re: What is the semantics meaning of 'object'?

2013-06-24 Thread Mark Janssen
>> Mostly I'm saying that super() is badly named. > > What else would you call a function that does lookups on the current > object's superclasses? ^. You make a symbol for it. ^__init__(foo, bar) -- MarkJ Tacoma, Washington -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the semantics meaning of 'object'?

2013-06-24 Thread Rotwang
On 24/06/2013 07:31, Steven D'Aprano wrote: On Mon, 24 Jun 2013 02:53:06 +0100, Rotwang wrote: On 23/06/2013 18:29, Steven D'Aprano wrote: On Sat, 22 Jun 2013 23:40:53 -0600, Ian Kelly wrote: [...] Can you elaborate or provide a link? I'm curious to know what other reason there could be for

Re: What is the semantics meaning of 'object'?

2013-06-24 Thread Roy Smith
In article <51c7fe14$0$29973$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > Mixins are such a limited version of MI that it's often not even counted > as MI, and even when it is, being familiar with mixins is hardly > sufficient to count yourself as familiar with MI. OK, fair e

Re: What is the semantics meaning of 'object'?

2013-06-24 Thread Steven D'Aprano
On Sun, 23 Jun 2013 21:38:33 -0400, Roy Smith wrote: > In article <51c7a087$0$2$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> On Sun, 23 Jun 2013 15:24:14 -0400, Roy Smith wrote: >> >> > In article <51c74373$0$2$c3e8da3$54964...@news.astraweb.com>, >> > Steven D'A

Re: What is the semantics meaning of 'object'?

2013-06-23 Thread Steven D'Aprano
On Mon, 24 Jun 2013 02:53:06 +0100, Rotwang wrote: > On 23/06/2013 18:29, Steven D'Aprano wrote: >> On Sat, 22 Jun 2013 23:40:53 -0600, Ian Kelly wrote: >>> [...] >>> >>> Can you elaborate or provide a link? I'm curious to know what other >>> reason there could be for magic methods to behave diff

Re: What is the semantics meaning of 'object'?

2013-06-23 Thread Rotwang
On 23/06/2013 18:29, Steven D'Aprano wrote: On Sat, 22 Jun 2013 23:40:53 -0600, Ian Kelly wrote: [...] Can you elaborate or provide a link? I'm curious to know what other reason there could be for magic methods to behave differently from normal methods in this regard. It's an efficiency opti

Re: What is the semantics meaning of 'object'?

2013-06-23 Thread Roy Smith
In article <51c7a087$0$2$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > On Sun, 23 Jun 2013 15:24:14 -0400, Roy Smith wrote: > > > In article <51c74373$0$2$c3e8da3$54964...@news.astraweb.com>, > > Steven D'Aprano wrote: > > >> What else would you call a function that

Re: What is the semantics meaning of 'object'?

2013-06-23 Thread Steven D'Aprano
On Sun, 23 Jun 2013 15:24:14 -0400, Roy Smith wrote: > In article <51c74373$0$2$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: >> What else would you call a function that does lookups on the current >> object's superclasses? > > Well, mro_lookup() would have been a better c

Re: What is the semantics meaning of 'object'?

2013-06-23 Thread Steven D'Aprano
On Sun, 23 Jun 2013 13:09:21 -0600, Ian Kelly wrote: > On Sun, Jun 23, 2013 at 12:50 PM, Steven D'Aprano > wrote: >> What else would you call a function that does lookups on the current >> object's superclasses? > > Well, as James Knight points out in the "Super Considered Harmful" > article, th

Re: What is the semantics meaning of 'object'?

2013-06-23 Thread Rick Johnson
On Sunday, June 23, 2013 11:49:42 AM UTC-5, Roy Smith wrote: > For what it's worth, I never bother to inherit from object > unless I know there's something I need from new style > classes. Undoubtedly, this creates a disturbance in The > Force, but such is life. Well, in Python 3000, if you don'

Re: What is the semantics meaning of 'object'?

2013-06-23 Thread Rick Johnson
On Sunday, June 23, 2013 11:15:38 AM UTC-5, Ian wrote: > If you're worried about efficiency, you can also > explicitly name the superclass in order to call the method > directly, like: I'm NOT worried about efficiency, i worried about readability, and using super (when super is NOT absolutely requ

Re: What is the semantics meaning of 'object'?

2013-06-23 Thread Roy Smith
In article <51c74373$0$2$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > On Sun, 23 Jun 2013 12:04:35 -0600, Ian Kelly wrote: > > > On Sun, Jun 23, 2013 at 11:36 AM, Steven D'Aprano > > wrote: > >> On Sun, 23 Jun 2013 11:18:41 -0600, Ian Kelly wrote: > >> > >>> Incidentally,

Re: What is the semantics meaning of 'object'?

2013-06-23 Thread Ian Kelly
On Sun, Jun 23, 2013 at 12:50 PM, Steven D'Aprano wrote: > What else would you call a function that does lookups on the current > object's superclasses? Well, as James Knight points out in the "Super Considered Harmful" article, the equivalent in Dylan is called "next-method", which isn't a valid

Re: What is the semantics meaning of 'object'?

2013-06-23 Thread Ian Kelly
On Sun, Jun 23, 2013 at 12:46 PM, Steven D'Aprano wrote: > All is not lost, there are ways to make your classes cooperative. The > trick is to have your classes' __init__ methods ignore keyword arguments > they don't know what to do with. object used to do the same thing, but it > no longer does,

Re: What is the semantics meaning of 'object'?

2013-06-23 Thread Steven D'Aprano
On Sun, 23 Jun 2013 12:04:35 -0600, Ian Kelly wrote: > On Sun, Jun 23, 2013 at 11:36 AM, Steven D'Aprano > wrote: >> On Sun, 23 Jun 2013 11:18:41 -0600, Ian Kelly wrote: >> >>> Incidentally, although super() is useful, it's not perfect, and this >>> is one of my grievances with it: that a user ca

Re: What is the semantics meaning of 'object'?

2013-06-23 Thread Steven D'Aprano
On Sun, 23 Jun 2013 12:49:42 -0400, Roy Smith wrote: > One thing I've never understood about Python 2.x's multiple inheritance > (mostly because I almost never use it) is how you do something like > this: > > class Base1(object): >def __init__(self, foo): > self.foo = foo > > class Bas

Re: What is the semantics meaning of 'object'?

2013-06-23 Thread Roy Smith
In article , Ian Kelly wrote: > Yes, you're missing that super() does not simply call the base class, > but rather the next class in the MRO for whatever the type of the > "self" argument is. If you write the above as: > > class Base1(object): >def __init__(self, foo, **kwargs): > su

Re: What is the semantics meaning of 'object'?

2013-06-23 Thread Ian Kelly
On Sun, Jun 23, 2013 at 11:36 AM, Steven D'Aprano wrote: > On Sun, 23 Jun 2013 11:18:41 -0600, Ian Kelly wrote: > >> Incidentally, although super() is useful, it's not perfect, and this is >> one of my grievances with it: that a user can, based upon the name, draw >> an inaccurate assumption about

Re: What is the semantics meaning of 'object'?

2013-06-23 Thread Steven D'Aprano
On Sun, 23 Jun 2013 11:18:41 -0600, Ian Kelly wrote: > Incidentally, although super() is useful, it's not perfect, and this is > one of my grievances with it: that a user can, based upon the name, draw > an inaccurate assumption about what it does without reading or fully > understanding the docum

Re: What is the semantics meaning of 'object'?

2013-06-23 Thread Steven D'Aprano
On Sat, 22 Jun 2013 23:40:53 -0600, Ian Kelly wrote: > On Sat, Jun 22, 2013 at 11:23 PM, Steven D'Aprano > wrote: >> On Sat, 22 Jun 2013 22:27:10 -0600, Ian Kelly wrote: >>> I actually consider that an up side. Sure it's inconvenient that you >>> can't delegate all such methods at once just by o

Re: What is the semantics meaning of 'object'?

2013-06-23 Thread Ian Kelly
On Sun, Jun 23, 2013 at 11:08 AM, Ian Kelly wrote: > On Sun, Jun 23, 2013 at 10:49 AM, Roy Smith wrote: >> am I missing something here? > > Yes, you're missing that super() does not simply call the base class, > but rather the next class in the MRO for whatever the type of the > "self" argument i

Re: What is the semantics meaning of 'object'?

2013-06-23 Thread Ian Kelly
On Sun, Jun 23, 2013 at 10:49 AM, Roy Smith wrote: > One thing I've never understood about Python 2.x's multiple inheritance > (mostly because I almost never use it) is how you do something like this: > > class Base1(object): >def __init__(self, foo): > self.foo = foo > > class Base2(obj

Re: What is the semantics meaning of 'object'?

2013-06-23 Thread Roy Smith
In article <51c723b4$0$2$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > On Sun, 23 Jun 2013 10:15:38 -0600, Ian Kelly wrote: > > > If you're worried about efficiency, you can also explicitly name the > > superclass in order to call the method directly, like: > > > >

Re: What is the semantics meaning of 'object'?

2013-06-23 Thread Steven D'Aprano
On Sun, 23 Jun 2013 10:15:38 -0600, Ian Kelly wrote: > If you're worried about efficiency, you can also explicitly name the > superclass in order to call the method directly, like: > > A.__init__(self, arg) Please don't. This is false economy. The time you save will be trivial, the over

Re: What is the semantics meaning of 'object'?

2013-06-23 Thread Ian Kelly
On Sun, Jun 23, 2013 at 7:35 AM, Adam Jiang wrote: > Another question raised here is that what is the proper way to refer > to parent class? For example, > > class A(object): > def __init__(self, arg): > print "A" > > class B(A): > def __init__(self, arg): >

Re: What is the semantics meaning of 'object'?

2013-06-23 Thread Adam Jiang
> * property only works in "new-style" classes that inherit from object; > > * likewise for super; Another question raised here is that what is the proper way to refer to parent class? For example, class A(object): def __init__(self, arg): print "A" class B(A): d

Re: What is the semantics meaning of 'object'?

2013-06-22 Thread Ian Kelly
On Sat, Jun 22, 2013 at 11:23 PM, Steven D'Aprano wrote: > On Sat, 22 Jun 2013 22:27:10 -0600, Ian Kelly wrote: >> I actually consider that an up side. Sure it's inconvenient that you >> can't delegate all such methods at once just by overriding >> __getattribute__, but it would be more troubleso

Re: What is the semantics meaning of 'object'?

2013-06-22 Thread Steven D'Aprano
On Sat, 22 Jun 2013 22:27:10 -0600, Ian Kelly wrote: > On Sat, Jun 22, 2013 at 9:20 PM, Steven D'Aprano > wrote: >> * on the down side, automatic delegation of special double-underscore >> methods like __getitem__ and __str__ doesn't work with new-style >> classes. > > I actually consider that a

Re: What is the semantics meaning of 'object'?

2013-06-22 Thread Ian Kelly
On Sat, Jun 22, 2013 at 9:20 PM, Steven D'Aprano wrote: > * on the down side, automatic delegation of special double-underscore > methods like __getitem__ and __str__ doesn't work with new-style classes. I actually consider that an up side. Sure it's inconvenient that you can't delegate all such

Re: What is the semantics meaning of 'object'?

2013-06-22 Thread Steven D'Aprano
On Sat, 22 Jun 2013 19:58:38 -0700, Adam wrote: > class FooBar(object): > def __init__(self): > ... > > Inheritance usually takes a class name to indicate which class is the > 'parent' class. However, in the previous example, from a django book, > the class actually takes an 'object'

What is the semantics meaning of 'object'?

2013-06-22 Thread Adam
class FooBar(object): def __init__(self): ... Inheritance usually takes a class name to indicate which class is the 'parent' class. However, in the previous example, from a django book, the class actually takes an 'object' like parameter, doesn't it? What is the semantics meaning of