Message47907
Logged In: YES
user_id=35752
Here's a quote from him:
> I'm beginning to think that we need an extra method
(__text__), that
> can return any kind of string that's compatible with
Python's text model.
>
> (in today's CPython, that's an 8-bit string with ASCII
only, or a Uni-
> code string. future Python's may support more string
types, at least at
> the C implementation level).
>
> I'm not sure we can change __str__ or __unicode__ without
breaking
> code in really obscure ways (but I'd be happy to be proven
wrong).
My idea is that we can change __str__ without breaking code.
The reason is that no one should be calling tp_str
directly. Instead they use PyObject_Str.
I don't know what he meant by "string that's compatible with
Python's text model". With my change, Python can only deal
with str or unicode instances. I have no idea how we could
support other string implementations.
I don't want to introduce a text() builtin that calls
__str__ and then later realize that __text__ would be a
useful. Perhaps this change is big enough to require a PEP. |
|
| Date |
User |
Action |
Args |
| 2007-08-23 15:42:06 | admin | link | issue1159501 messages |
| 2007-08-23 15:42:06 | admin | create | |
|