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 ezio.melotti
Recipients ezio.melotti, gvanrossum, mrabarnett
Date 2013-07-18.13:05:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1374152715.43.0.84616492973.issue18468@psf.upfronthosting.co.za>
In-reply-to
Content
I'm not sure it's worth changing it.
As I see it, match/search are supposed to work with str or bytes and they return str/bytes accordingly.  The fact that they work with other bytes-like objects seems to me an undocumented implementation detail people should not rely on.
If they are passing bytes-like object, both the current behavior (return same type) or the new proposed behavior (always return bytes) seem reasonable expectations.

IIUC the advantage of changing the behavior is that it won't keep the target string alive anymore, but on the other hand is not backward compatible and makes things more difficult for people who want the same type back.
If people always want bytes back regardless of the input, they can convert the input or output to bytes explicitly.
History
Date User Action Args
2013-07-18 13:05:15ezio.melottisetrecipients: + ezio.melotti, gvanrossum, mrabarnett
2013-07-18 13:05:15ezio.melottisetmessageid: <1374152715.43.0.84616492973.issue18468@psf.upfronthosting.co.za>
2013-07-18 13:05:15ezio.melottilinkissue18468 messages
2013-07-18 13:05:14ezio.melotticreate