Demian Brecht added the comment:

No worries.

The change is not backwards incompatible. test_urllib2 test pass without any 
modification (I'm getting a segfault in test_heapq atm so can't run the full 
suite). I've simply moved the side effects cause by __init__ to a setter so 
that full_url may be set after instantiation and will still incur the same 
results as after initial creation.

The biggest problem with this particular attribute and the way that it's 
currently handled is inconsistent with the rest of the class. The only other 
attribute that incurs side effects when set (data) is implemented with 
@property getter and setters. When set, it incurs side effects on the headers 
(removing Content-Length). Unless I'm missing something, other attributes are 
directly mutable and do not incur side effects on instance state when set.

In my mind, if full_url is publicly accessible, then it should be publicly 
accessible /and/ settable. It currently is not without causing invalid state 
within a given Request instance.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17272>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to