[Python-Dev] Supporting raw bytes data in urllib.parse.* (was Re: Polymorphic best practices)

Nick Coghlan ncoghlan at gmail.com
Mon Sep 20 13:34:37 CEST 2010

On Mon, Sep 20, 2010 at 2:12 PM, Glyph Lefkowitz
<glyph at twistedmatrix.com> wrote:
> While I don't like the email6 precedent as such (that there would be
> different parsed objects, based on whether you started parsing with bytes or
> with strings), the idea that when you are working directly with bytes or
> text, you should have to know which one you have, is a good one.  +1 for
> keeping the APIs separate with 'urlsplitb' etc.

It's primarily the "am I dealing with bytes" or "am I dealing with
text" precedent that I'm copying. That said, I'm not personally
opposed to that distinction propagating to higher level data
structures when it makes sense (e.g., to some degree it will propagate
naturally in urllib.parse, since the tuples of URL fragments can be
seen as higher level data structures analogous to the data structures
in email6).


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-Dev mailing list