ISTM, the whole reason people are asking for a String ABC is so you can write isinstance(obj, String) and allow registered
string-like objects to be accepted.
The downside is that everytime you want this for a concrete class or type, it is necessary to write a whole new ABC listing all of
the r
I'm willing to meet you halfway. I really don't want isinstance(x,
str) to return True for something that doesn't inherit from the
concrete str type; this is bound to lead to too much confusion and
breakage. But I'm fine with a String ABC (or any other ABC, e.g.
Atomic?) that doesn't define any me
Raymond Hettinger wrote:
If we don't do this, then String won't be the last request. People will
want Datetime for example. Pretty much any concrete type could have a
look-a-like that wanted its own ABC and for all client code to switch
from testing concrete types.
If I remember rightly, th
On Sat, May 31, 2008 at 6:41 PM, Raymond Hettinger <[EMAIL PROTECTED]> wrote:
> From: "Guido van Rossum" <[EMAIL PROTECTED]>
>> I'm willing to meet you halfway. I really don't want isinstance(x,
>> str) to return True for something that doesn't inherit from the
>> concrete str type; this is bound t
From: "Guido van Rossum" <[EMAIL PROTECTED]>
I'm willing to meet you halfway. I really don't want isinstance(x,
str) to return True for something that doesn't inherit from the
concrete str type; this is bound to lead to too much confusion and
breakage.
Probably true. It was an attractive id
[Raymond]
I propose the following empty abstract classes: String, Datetime, Deque,
and Socket.
[GvR]
Sounds like a mini-PEP is in place. It should focus on the code to
actually define these and the intended ways to use them.
Okay, will run a Google code search to see if real code exists
On Sat, May 31, 2008 at 8:09 PM, Raymond Hettinger <[EMAIL PROTECTED]> wrote:
> [Raymond]
>>>
>>> I propose the following empty abstract classes: String, Datetime,
>>> Deque,
>>> and Socket.
>
> [GvR]
>>
>> Sounds like a mini-PEP is in place. It should focus on the code to
>> actually define th
2008/6/1 Guido van Rossum <[EMAIL PROTECTED]>:
>> The case for String has already been made.
>
> Actually I'm not sure. One you know that isinstance(x, String) is
> true, what can you assume you can do with x?
[...]
> Right. I'm now beginning to wonder what exactly you're after here --
> saying tha
On Sun, Jun 1, 2008 at 6:57 AM, Paul Moore <[EMAIL PROTECTED]> wrote:
> 2008/6/1 Guido van Rossum <[EMAIL PROTECTED]>:
>>> The case for String has already been made.
>>
>> Actually I'm not sure. One you know that isinstance(x, String) is
>> true, what can you assume you can do with x?
> [...]
>> Ri