[Patches] [ python-Patches-624325 ] attributes for urlsplit, urlparse result

noreply@sourceforge.net noreply@sourceforge.net
Thu, 14 Nov 2002 09:37:32 -0800


Patches item #624325, was opened at 2002-10-16 17:59
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=624325&group_id=5470

Category: Library (Lib)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Fred L. Drake, Jr. (fdrake)
>Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: attributes for urlsplit, urlparse result

Initial Comment:
This patch to Lib/urlparse.py makes the fields of the
results accessible as named attributes from the result
object.  The result objects are still small since they
derive from tuple and have no __dict__, though there's
some additional cost in construction (a temporary tuple
is created and passed to tuple.__new__).

----------------------------------------------------------------------

>Comment By: Guido van Rossum (gvanrossum)
Date: 2002-11-14 12:37

Message:
Logged In: YES 
user_id=6380

I'm fine with this, but we decided to use a different
approach (for the same effect): make structseq usable from
Python code. That's being discussed in bug 624827. Pending
that, this one's on hold.

----------------------------------------------------------------------

Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2002-10-17 16:03

Message:
Logged In: YES 
user_id=3066

Based on comments from Guido, provide a geturl() method
instead of the url property, since it actually does more
work than just retrieving data.

----------------------------------------------------------------------

Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2002-10-17 13:09

Message:
Logged In: YES 
user_id=3066

New version of the patch.

This adds a "url" attribute to each type of result,
providing the result of urlunsplit() / urlunparse() for the
components of the result object.

Tests and documentation have been updated.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=624325&group_id=5470