From: John Nagle on
Here's dir(types), in Python 2.6.5:

['BooleanType', 'BufferType', 'BuiltinFunctionType',
'BuiltinMethodType', 'ClassType', 'CodeType', 'ComplexType',
'DictProxyType', 'DictType', 'DictionaryType', 'EllipsisType',
'FileType', 'FloatType', 'FrameType', 'FunctionType', 'GeneratorType',
'GetSetDescriptorType', 'InstanceType', 'IntType', 'LambdaType',
'ListType', 'LongType', 'MemberDescriptorType', 'MethodType',
'ModuleType', 'NoneType','NotImplementedType', 'ObjectType',
'SliceType', 'StringType', 'StringTypes', 'TracebackType', 'TupleType',
'TypeType', 'UnboundMethodType', 'UnicodeType', 'XRangeType',
'__builtins__', '__doc__', '__file__', '__name__', '__package__']

Seems to be missing SetType, FrozenSetType, BytesType, and
ByteArrayType. Anything else missing?

(Arguably, "bytes" isn't really distinguished until 3.x, but
still...)

John Nagle
From: Stephen Hansen on
Sent from my iPad

On Jun 23, 2010, at 9:24 PM, John Nagle <nagle(a)animats.com> wrote:

> Here's dir(types), in Python 2.6.5:
>
> ['BooleanType', 'BufferType', 'BuiltinFunctionType', 'BuiltinMethodType', 'ClassType', 'CodeType', 'ComplexType', 'DictProxyType', 'DictType', 'DictionaryType', 'EllipsisType', 'FileType', 'FloatType', 'FrameType', 'FunctionType', 'GeneratorType', 'GetSetDescriptorType', 'InstanceType', 'IntType', 'LambdaType', 'ListType', 'LongType', 'MemberDescriptorType', 'MethodType', 'ModuleType', 'NoneType','NotImplementedType', 'ObjectType', 'SliceType', 'StringType', 'StringTypes', 'TracebackType', 'TupleType', 'TypeType', 'UnboundMethodType', 'UnicodeType', 'XRangeType', '__builtins__', '__doc__', '__file__', '__name__', '__package__']
>
> Seems to be missing SetType, FrozenSetType, BytesType, and
> ByteArrayType. Anything else missing?
>
> (Arguably, "bytes" isn't really distinguished until 3.x, but
> still...)
>
> John Nagle
> --
> http://mail.python.org/mailman/listinfo/python-list
From: Stephen Hansen on
On Jun 23, 2010, at 9:24 PM, John Nagle <nagle(a)animats.com> wrote:

> Here's dir(types), in Python 2.6.5:
>
> ['BooleanType', 'BufferType', 'BuiltinFunctionType', 'BuiltinMethodType', 'ClassType', 'CodeType', 'ComplexType', 'DictProxyType', 'DictType', 'DictionaryType', 'EllipsisType', 'FileType', 'FloatType', 'FrameType', 'FunctionType', 'GeneratorType', 'GetSetDescriptorType', 'InstanceType', 'IntType', 'LambdaType', 'ListType', 'LongType', 'MemberDescriptorType', 'MethodType', 'ModuleType', 'NoneType','NotImplementedType', 'ObjectType', 'SliceType', 'StringType', 'StringTypes', 'TracebackType', 'TupleType', 'TypeType', 'UnboundMethodType', 'UnicodeType', 'XRangeType', '__builtins__', '__doc__', '__file__', '__name__', '__package__']
>
> Seems to be missing SetType, FrozenSetType, BytesType, and
> ByteArrayType. Anything else missing?
>
> (Arguably, "bytes" isn't really distinguished until 3.x, but
> still...)

IIUC, since Python 2.2ish you can't treat the types module as
comprehensive. It exists as a remnant from the time when there was a
difference between types and classes.

Sets and the recent additions exist solely in this new world where we
just isinstance(blah, set) or issubclass or whatnot.

--Stephen via iPad
From: John Nagle on
On 6/23/2010 10:08 PM, Stephen Hansen wrote:
> On Jun 23, 2010, at 9:24 PM, John Nagle<nagle(a)animats.com> wrote:
>
>> Here's dir(types), in Python 2.6.5:
>>
>> ['BooleanType', 'BufferType', 'BuiltinFunctionType', 'BuiltinMethodType', 'ClassType', 'CodeType', 'ComplexType', 'DictProxyType', 'DictType', 'DictionaryType', 'EllipsisType', 'FileType', 'FloatType', 'FrameType', 'FunctionType', 'GeneratorType', 'GetSetDescriptorType', 'InstanceType', 'IntType', 'LambdaType', 'ListType', 'LongType', 'MemberDescriptorType', 'MethodType', 'ModuleType', 'NoneType','NotImplementedType', 'ObjectType', 'SliceType', 'StringType', 'StringTypes', 'TracebackType', 'TupleType', 'TypeType', 'UnboundMethodType', 'UnicodeType', 'XRangeType', '__builtins__', '__doc__', '__file__', '__name__', '__package__']
>>
>> Seems to be missing SetType, FrozenSetType, BytesType, and
>> ByteArrayType. Anything else missing?
>>
>> (Arguably, "bytes" isn't really distinguished until 3.x, but
>> still...)
>
> IIUC, since Python 2.2ish you can't treat the types module as
> comprehensive. It exists as a remnant from the time when there was a
> difference between types and classes.
>
> Sets and the recent additions exist solely in this new world where we
> just isinstance(blah, set) or issubclass or whatnot.

Ah. That makes sense.

Does the "types" module go away in 3.x, then?

John Nagle
From: Ian Kelly on
On Thu, Jun 24, 2010 at 12:29 AM, John Nagle <nagle(a)animats.com> wrote:
>   Does the "types" module go away in 3.x, then?

Not entirely, but it is greatly reduced.