In article , kj
wrote:
>
>standard OOP semantics
"...some experts might say a C++ program is not object-oriented without
inheritance and virtual functions. As one of the early Smalltalk
implementors myself, I can say they are full of themselves." --zconcept
--
Aahz (a...@pythoncraft.com)
ers:
>>>
>>> (v. 2.7.0)
>>>>>> from collections import Mapping
>>>>>> issubclass(dict, Mapping)
>>> True
>>>>>> dict.__bases__
>>> (,)
>>>>>> [issubclass(b, Mapping) for b in dict.__bases__]
>
In <4d127d5e$0$29997$c3e8da3$54964...@news.astraweb.com> Steven D'Aprano
writes:
>On Wed, 22 Dec 2010 14:20:51 +, kj wrote:
>> Here's another example, fresh from today's crop of wonders:
>>
>> (v. 2.7.0)
>>>>> from collectio
On Wed, 22 Dec 2010 14:20:51 +, kj wrote:
> Here's another example, fresh from today's crop of wonders:
>
> (v. 2.7.0)
>>>> from collections import Mapping
>>>> issubclass(dict, Mapping)
> True
>>>> dict.__bases__
> (,)
&
On 12/22/2010 9:20 AM, kj wrote:
from collections import Mapping
Documented as an *ABSTRACT* base class. ABCs were added in 3.0 and
backparted to 2.7. One can be quite competant in Python completely
ignoring ABCs.
issubclass(dict, Mapping)
True
Yes, dict is a concrete Mapping class. I
'? It sounds to me
like you are looking at 'master'.
Here's another example, fresh from today's crop of wonders:
(v. 2.7.0)
from collections import Mapping
issubclass(dict, Mapping)
True
dict.__bases__
(,)
[issubclass(b, Mapping) for b in dict.__bases__]
[False
On 12/22/2010 9:20 AM, kj wrote:
[...]
> I suspect this is another abstraction leak ("dict is *supposed* to
> be a Python class like all others, but in fact it's not *really*.
> You see, once upon a time...").
>
So your suspicions are to be placed above the knowledge of those who
really do underst
On Wed, 22 Dec 2010 09:35:48 -0500
Adam Tauno Williams wrote:
>
> IMO, the "object model" isn't "leaky", it is simply "adhoc" and not
> really a "model" at all [write as many 800 page books as you want: if it
> walks like a zombie duck, smells like a zombie duck - it is still a
> zombie duck]. P
On Wed, 22 Dec 2010 14:20:51 + (UTC)
kj wrote:
>
> So dict is a subclass of Mapping, even though none of the bases of
> dict is either Mapping or a subclass of Mapping. Great.
>
> I suspect this is another abstraction leak ("dict is *supposed* to
> be a Python class like all others, but in
ot;implementation details". When an abstraction
> leaks, implementation details are no longer negligible, they cease
> to be "little corner cases".
> Here's another example, fresh from today's crop of wonders:
> (v. 2.7.0)
> >>> from collections
to be "little corner cases".
Here's another example, fresh from today's crop of wonders:
(v. 2.7.0)
>>> from collections import Mapping
>>> issubclass(dict, Mapping)
True
>>> dict.__bases__
(,)
>>> [issubclass(b, Mapping) for b in dict.__bas
11 matches
Mail list logo