This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: HTTPSConnect.__init__ too tricky
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: jhylton Nosy List: gvanrossum, jhylton, rsalz
Priority: low Keywords:

Created on 2001-09-04 17:27 by rsalz, last changed 2022-04-10 16:04 by admin. This issue is now closed.

Messages (3)
msg6353 - (view) Author: Rich Salz (rsalz) Date: 2001-09-04 17:27
The code in HTTPSConnect's ctor is way too tricky.  How
about this:
   for k in x509.keys():
     if k not in ['key_file', 'cert_file']:
       raise InvalidKeywordArgument()
if you NEED to be clever then use a list comprehensive
  if [ k for k in x509.keys() if k not in
['key_file','cert_file']]:
    raise InvalidKeywordArgument()

(It's also inefficient copying the keys only to delete
them, in case you need a real justification. ;)
msg6354 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2001-09-04 18:36
Logged In: YES 
user_id=6380

Looks like your alternative still makes a copy.

What I personally don't get about that piece of code is why
the function doesn't just declare arguments with default
values of None and be done with it.

Assigned to Greg Stein for judgement. Personally, I'd say
there are bigger fish to fry. :-)
msg6355 - (view) Author: Jeremy Hylton (jhylton) (Python triager) Date: 2002-06-28 23:38
Logged In: YES 
user_id=31392

Fixed as Guido suggested in rev. 1.53 of httplib.py
History
Date User Action Args
2022-04-10 16:04:24adminsetgithub: 35106
2001-09-04 17:27:09rsalzcreate