diff options
author | Raymond Hettinger <python@rcn.com> | 2005-02-06 06:57:08 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2005-02-06 06:57:08 (GMT) |
commit | dbecd93b7203cd187c1978de1207c29d3a9a686c (patch) | |
tree | abb7331791de7b8e85208195e0c948a76cf77b67 /Lib/cookielib.py | |
parent | 07ead1731850a9f1bd353b9330341309251099b6 (diff) | |
download | cpython-dbecd93b7203cd187c1978de1207c29d3a9a686c.zip cpython-dbecd93b7203cd187c1978de1207c29d3a9a686c.tar.gz cpython-dbecd93b7203cd187c1978de1207c29d3a9a686c.tar.bz2 |
Replace list of constants with tuples of constants.
Diffstat (limited to 'Lib/cookielib.py')
-rw-r--r-- | Lib/cookielib.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/cookielib.py b/Lib/cookielib.py index 86479f8..268cc20 100644 --- a/Lib/cookielib.py +++ b/Lib/cookielib.py @@ -783,12 +783,12 @@ class Cookie: def __repr__(self): args = [] - for name in ["version", "name", "value", + for name in ("version", "name", "value", "port", "port_specified", "domain", "domain_specified", "domain_initial_dot", "path", "path_specified", "secure", "expires", "discard", "comment", "comment_url", - ]: + ): attr = getattr(self, name) args.append("%s=%s" % (name, repr(attr))) args.append("rest=%s" % repr(self._rest)) @@ -981,9 +981,9 @@ class DefaultCookiePolicy(CookiePolicy): if j == 0: # domain like .foo.bar tld = domain[i+1:] sld = domain[j+1:i] - if (sld.lower() in [ + if (sld.lower() in ( "co", "ac", - "com", "edu", "org", "net", "gov", "mil", "int"] and + "com", "edu", "org", "net", "gov", "mil", "int") and len(tld) == 2): # domain like .co.uk debug(" country-code second level domain %s", domain) @@ -1415,7 +1415,7 @@ class CookieJar: v = self._now + v if (k in value_attrs) or (k in boolean_attrs): if (v is None and - k not in ["port", "comment", "commenturl"]): + k not in ("port", "comment", "commenturl")): debug(" missing value for %s attribute" % k) bad_cookie = True break |