A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2007-March/071490.html below:

[Python-Dev] About code comments policy (and Handler order in urllib2)

[Python-Dev] About code comments policy (and Handler order in urllib2) [Python-Dev] About code comments policy (and Handler order in urllib2)Facundo Batista facundo at taniquetil.com.ar
Mon Mar 5 16:44:01 CET 2007
One question and one answer (this is a balanced post, :p).

The question is what to do when we found a question in a code. Reading
urllib2 I found:

  # XXX why does self.handlers need to be sorted?

I found the answer, so I deleted that line, and added a comment in that
place just to clarify. 

Shall I do something else? Like posting here the answer?

BTW, the answer to that question is that the handlers must work in an
specific order. The order is specified in each Handler (handler_order
class attribute), and BaseHandler has __lt__ defined using that
attribute. So, OpenerDirector, keeps self.handler ordered with
bisect.insort.

Regards,

-- 
.   Facundo
.
Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/



More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4