This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Pam.McANulty
Recipients Pam.McANulty, fdrake, pitrou
Date 2013-04-15.14:28:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
- eval expects bytes to have a continuation character and test_str_wrap did an eval check so I figured test_bytes_wrap should as well:

# repr some bytes:
>>> b = b"\x00\xff" * 5
>>> b
>>> r = repr(b)
>>> r
>>> eval(r)

# hand-wrap it without the continuation character and it fails to eval (stuck the 
>>> s = "b'\\x00\\xff\\x00\\xff\\x00'\nb'\\xff\\x00\\xff\\x00\\xff'"
>>> print(s)
>>> eval(s)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 2
SyntaxError: invalid syntax

# stick the continuation character in, and it evals properly
>>> s = s.replace("\n", "\\\n")
>>> print(s)
>>> eval(s)

- I agree about the len v _len, but figured this wasn't all that foolish a consistency issue (i.e. the rest of used _len)

- I also wanted to refactor _str_parts and _bytes_parts, but couldn't decide on the best course.  I was favoring a helper function to run the common loop since the two "if issubclass..." calls were so different and parameterizing the differences felt like it would obfuscate things too much.

- I also agree on the doc.  I figured I'd see if there weren't any hidden surprises with the patch before I worked on better doc.
Date User Action Args
2013-04-15 14:28:53Pam.McANultysetrecipients: + Pam.McANulty, fdrake, pitrou
2013-04-15 14:28:53Pam.McANultysetmessageid: <>
2013-04-15 14:28:53Pam.McANultylinkissue17530 messages
2013-04-15 14:28:53Pam.McANultycreate