[Python-Dev] Re: 2.1 strangness

Robin Becker robin@jessikat.fsnet.co.uk
Thu, 31 May 2001 19:33:02 +0100


In message <15126.34635.67975.31473@beluga.mojam.com>, Skip Montanaro
<skip@pobox.com> writes
>>>>>> "Robin" == Robin Becker <robin@jessikat.fsnet.co.uk> writes:
>
>    Robin> from httplib import *
>
>    Robin> class Bongo(HTTPConnection):
>    Robin>         pass
>    ...
>    Robin> NameError: name 'HTTPConnection' is not defined
>
>It was a brain fart on my part when creating httplib.__all__.
>HTTPConnection was not included in that list.  I will check in a fix.
>In the 2.1 release __all__ was defined as 
>
>    __all__ = ["HTTP"]
>
>I have changed that to
>
>    __all__ = ["HTTP", "HTTPResponse", "HTTPConnection", "HTTPSConnection",
>              "HTTPException", "NotConnected", "UnknownProtocol",
>              "UnknownTransferEncoding", "IllegalKeywordArgument",
>              "UnimplementedFileMode", "IncompleteRead",
>              "ImproperConnectionState", "CannotSendRequest", 
>"CannotSendHeader",
>              "ResponseNotReady", "BadStatusLine", "error"]

thanks; I'm still a bit puzzled as to the exact semantics. It just looks
wrong. Is __all__ the only way to get things into the * version of
import? Presumably HTTPConnection is being marked as a potential global
in the compile phase.
-- 
Robin Becker