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 r.david.murray
Recipients BreamoreBoy, ezio.melotti, georg.brandl, hynek, markon, o11c, pitrou, r.david.murray, serhiy.storchaka, swarecki, tzimmo
Date 2013-01-14.20:05:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1358193945.33.0.740123195661.issue6975@psf.upfronthosting.co.za>
In-reply-to
Content
Vis the discussion of x[:0] in the review.  This kind of construct is only unfamiliar because it is new in Python3, and there are not *that* many places that you want to (and can) deal with both bytes and strings using the same code.  But when you can, it is the more-or-less obvious way to write the code.

In this particular case you could also write type(x)().  There are pluses and minuses to both forms, but if any of the rest of the code uses slicing to work around the fact that byte strings index into ints, then I would definitely prefer the slice form.
History
Date User Action Args
2013-01-14 20:05:45r.david.murraysetrecipients: + r.david.murray, georg.brandl, pitrou, swarecki, ezio.melotti, markon, BreamoreBoy, hynek, serhiy.storchaka, o11c, tzimmo
2013-01-14 20:05:45r.david.murraysetmessageid: <1358193945.33.0.740123195661.issue6975@psf.upfronthosting.co.za>
2013-01-14 20:05:45r.david.murraylinkissue6975 messages
2013-01-14 20:05:45r.david.murraycreate