[IronPython] Better dir() for Enum

Sanghyeon Seo sanxiyn at gmail.com
Thu Jun 1 03:14:09 CEST 2006


Let's illustrate this feature request with an interactive session:

>>> import System

>>> dir(System.IO.FileMode)
['Append', 'CompareTo', 'Create', 'CreateNew', 'Equals', 'Finalize',
'Format', 'GetHashCode', 'GetName', 'GetNames', 'GetType',
'GetTypeCode', 'GetUnderlyingType', 'GetValues', 'IsDefined',
'MemberwiseClone', 'Open', 'OpenOrCreate', 'Parse', 'ToBoolean',
'ToByte', 'ToChar', 'ToDateTime', 'ToDecimal', 'ToDouble', 'ToInt16',
'ToInt32', 'ToInt64', 'ToObject', 'ToSByte', 'ToSingle', 'ToString',
'ToType', 'ToUInt16', 'ToUInt32', 'ToUInt64', 'Truncate', '__class__',
'__init__', '__module__', '__repr__', 'value__']

>>> sorted(System.Enum.GetNames(System.IO.FileMode))
['Append', 'Create', 'CreateNew', 'Open', 'OpenOrCreate', 'Truncate']

I think there's no doubt that the later output is more useful. But I'm
not sure whether this feature request interferes with other possible
features of IronPython.

If the above is undesirable, at least this could be improved:

>>> print System.IO.FileMode.__doc__
no documentation available

Seo Sanghyeon



More information about the Ironpython-users mailing list