Issue1247
Created on 2007-10-08 16:39 by christian.heimes, last changed 2007-10-31 23:30 by gvanrossum.
|
msg56280 - (view) |
Author: Christian Heimes (christian.heimes) |
Date: 2007-10-08 16:39 |
|
The patches changes:
- change PyString's repr() to return "b'...'"
- change PyBytes's repr() to return "buffer(b'...')"
- change parser so that b"..." returns PyString, not PyBytes
- rename bytes -> buffer, str8 -> bytes
The patch breaks some unit test because some of the infrastructure like
the new buffer() isn't in place yet. I'm not happy with bytes_repr() but
the for loop with *p++ was the easiest way to implement it. Every other
implementation I could think of was either too complicated or wouldn't
work (like memcpy).
|
|
msg56282 - (view) |
Author: Alexandre Vassalotti (alexandre.vassalotti) |
Date: 2007-10-09 03:28 |
|
I am not sure how the parser work, so I can't comment if your change to
it is correct. It would probably a better idea to keep it for later,
when the semantic differences between str8 and bytes objects will be
resolved.
I think changing b'' to buffer(b''), in the tests, is not a good idea.
These tests will need to be changed again when bytes() will be changed
to str8().
Your changes to PyString and PyBytes look good to me. As I said on the
mailing list, I think the for-loops in bytes_repr() should be changed to:
while (*quote_prefix)
*p++ = *quote_prefix++;
I attached updated patches with the above change. I also replaced
bytes() for buffer() in PyBytes's docstrings.
|
|
msg56287 - (view) |
Author: Guido van Rossum (gvanrossum) |
Date: 2007-10-09 17:22 |
|
GHave you two agreed yet as to which patch(es) I should look at?
|
|
msg56289 - (view) |
Author: Christian Heimes (christian.heimes) |
Date: 2007-10-09 18:19 |
|
Guido van Rossum wrote:
> Guido van Rossum added the comment:
>
> GHave you two agreed yet as to which patch(es) I should look at?
Please commit Alexandres patch. His patch for bytesobject.c is based on
my patch. It's more complete and a bit better than mine, too. I'm going
to create a new patch for the other tasks later.
|
|
msg56294 - (view) |
Author: Guido van Rossum (gvanrossum) |
Date: 2007-10-09 22:46 |
|
I don't think I can check these in yet; right now they are inconsistent.
But I will check them in when they are ready.
|
|
msg56806 - (view) |
Author: Guido van Rossum (gvanrossum) |
Date: 2007-10-26 18:26 |
|
Setting to 'high' everything related to PEP 3137.
|
|
msg56843 - (view) |
Author: Christian Heimes (christian.heimes) |
Date: 2007-10-27 04:05 |
|
Here is the patch that contains only the harmless parts of the previous
patches. It changes a bunch of doc strings, changes the name of the
types and their repr() and str(). It also adds __builtin__.buffer but it
leaves __builtin__.bytes, __builtin__.str8 and b'' as they are.
|
|
msg57006 - (view) |
Author: Guido van Rossum (gvanrossum) |
Date: 2007-10-31 23:30 |
|
I've submitted the 'harmless' patch (and much, much more) in r58741.
I'm closing this now, the rest probably has been implemented one way or
another as well. If you see something I missed, please open a new issue
with a patch for just that issue.
|
|
| Date |
User |
Action |
Args |
| 2007-10-31 23:30:20 | gvanrossum | set | status: open -> closed resolution: accepted messages:
+ msg57006 |
| 2007-10-29 05:16:24 | gregory.p.smith | set | nosy:
+ gregory.p.smith |
| 2007-10-27 04:05:38 | christian.heimes | set | files:
+ py3k-pep3137_harmless.patch messages:
+ msg56843 |
| 2007-10-26 18:26:19 | gvanrossum | set | priority: high messages:
+ msg56806 |
| 2007-10-09 22:46:33 | gvanrossum | set | assignee: gvanrossum messages:
+ msg56294 |
| 2007-10-09 18:19:06 | christian.heimes | set | messages:
+ msg56289 |
| 2007-10-09 17:22:44 | gvanrossum | set | nosy:
+ gvanrossum messages:
+ msg56287 |
| 2007-10-09 03:29:22 | alexandre.vassalotti | set | files:
+ tmp_test_bytes_fix.patch |
| 2007-10-09 03:29:05 | alexandre.vassalotti | set | files:
+ change_string_repr_prefix.patch |
| 2007-10-09 03:28:28 | alexandre.vassalotti | set | files:
+ change_bytes_repr_for_buffer.patch nosy:
+ alexandre.vassalotti messages:
+ msg56282 |
| 2007-10-08 16:53:58 | loewis | set | keywords:
+ patch |
| 2007-10-08 16:39:20 | christian.heimes | create | |
|