-
Notifications
You must be signed in to change notification settings - Fork 282
Closed
Description
The current specification of tuf.interposition interposes as urllib and urllib2 in an implicit fashion:
tuf.interposition.interpose()
# Now you have TUF...
url = 'http://example.com/path/to/document'
urllib.urlopen( url )
urllib.urlretrieve( url )
urllib2.urlopen( url )
tuf.interposition.go_away()
# ...and now you don't!Justin's argument is that it is not obvious that tuf.interposition.interpose() modifies urllib and urllib2. What else might the function modify unseen?
Following Python's guideline of "explicit is better than implicit", and the principle of least astonishment, we should change this interposition mechanism to look more like:
from tuf.interposition import urllib, urllib2
urllib.urlopen( url )
urllib2.urlopen( url )Metadata
Metadata
Assignees
Labels
No labels