On Wed, Dec 24, 2008 at 6:10 PM, Federico G. Schwindt <fg...@lodoss.net> wrote:

>  do you mind to explain why you've added has_timeout()?
>  if timeout is _GLOBAL_DEFAULT_TIMEOUT, you'll be setting it without
> effect, so why having a separate function for basically a noop?

the problem is that timeout isn't always _GLOBAL_DEFAULT_TIMEOUT, and
_GLOBAL_DEFAULT_TIMEOUT appeared in python 2.6.
,

>  Any reason you have not done:
>
>  try:
>      from hashlib import sha1 as sha
>      from hashlib import md5 as md5
>  except ImportError:
>      from sha import sha as sha
>      from md5 import md5 as md5
>
>  and then just use md5/sha?  seems more natural to me.

If you do that you will have to change all the lines in the code see :

before python 2.5/2.6 you had to use the new method to create md5 =
m5.new, the same for sha. Now you don't need to use this method. The
fact I renamed to _md5 rather than md5 is to avoid confusion and keep
this name somelike private. I followed PEP 8 for that.


>  need to look at the ssl part of the diff.

This a common wrapper these days for those working with project that
need to work on py25 and py26.

This patch try to avoid any code duplication and solve current problem
of httplib2. Anyway if you have another patch to do the same thing,
let me know I will be pleased to test it :-)

- benoƮt

Reply via email to