[IronPython] Better dir() for Enum
Dino Viehland
dinov at exchange.microsoft.com
Wed May 31 18:23:05 PDT 2006
I like the __doc__ idea a lot. I don't think we want to go changing the semantics of dir, but obviously we can put anything we want in __doc__.
We're also planning in finally implementing help(), which would also presumably include this info, so ulitmately it'll only be one more character than dir().
________________________________________
From: users-bounces at lists.ironpython.com On Behalf Of Sanghyeon Seo
Sent: Wednesday, May 31, 2006 6:14 PM
To: Discussion of IronPython
Subject: [IronPython] Better dir() for Enum
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
_______________________________________________
users mailing list
users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 4466 bytes
Desc: not available
Url : /pipermail/users-ironpython.com/attachments/20060531/4fa29509/winmail.bin
More information about the users
mailing list