|
The CLR names are still available on __builtins__ (but strangely
not on __builtin__ when it is imported). As a somewhat ugly workaround, you can
copy the names from __builtins__ into your local namespace: >>> import clr >>> HasAttr Traceback (most recent call last): File , line 0, in <stdin>##6 NameError: name 'HasAttr' not defined >>> for attr in dir(__builtins__): ... locals()[attr] = getattr(__builtins__, attr) ... >>> >>> HasAttr <built-in function HasAttr> >>> You can also copy them into globals() if you want them available
everywhere. --Bruce From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Lee Culver What about the previous email? I currently cannot access any
IronPython specific constructs which are in the __builtins__ module, or any
other module: >>> import clr >>> HasAttr Traceback (most recent call last): File , line 0, in <stdin>##16 NameError: name 'HasAttr' not defined >>> __builtins__.HasAttr <built-in function HasAttr> Other modules have similar problems, such as: >>> import clr >>> import thread >>> thread.StartNewThread Traceback (most recent call last): File , line 0, in <stdin>##19 AttributeError: 'module' object has no attribute 'StartNewThread' Whereas StartNewThread was a .Net style alias for
thread.start_new_thread in IronPython 8. Thanks, -Lee From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Martin Maly Yep, we have entered the ToString issue, but your operator issue is
a new one. I’ve filed it in CodePlex as work item 939 Martin From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Lee Culver And another one… IronPython 1.0.60712 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> >>>
clr.AddReferenceByPartialName("Microsoft.DirectX") >>> from Microsoft import DirectX >>> v = DirectX.Vector3(1, 2, 3) >>> v * 2 ...]>osoft.DirectX.Vector3 object at 0x000000000000002C [Z : 6 >>> v * 2.2 Traceback (most recent call last): File , line 0, in <stdin>##30 TypeError: unsupported operand type(s) for *: 'Vector3' and 'float' Whereas this worked fine in IronPython8 (and indeed the
DirectX.Vector3 class supports a multiplication with floats): IronPython 1.0.2376 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>>
clr.AddReferenceByPartialName("Microsoft.DirectX") >>> v = DirectX.Vector3(1, 2, 3) Traceback (most recent call last): File , line 0, in <stdin>##13 NameError: name 'DirectX' not defined >>> from Microsoft import DirectX >>> v = DirectX.Vector3(1, 2, 3) >>> v * 2 Z : 6 Y : 4 X : 2 >>> v * 2.2 Z : 6.6 Y : 4.4 X : 2.2 I think the ToString issue has already been reported… Thanks -Lee From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Lee Culver This
seems to not work anymore: >>>
import clr >>>
HasAttr Traceback
(most recent call last):
File , line 0, in <stdin>##9 NameError:
name 'HasAttr' not defined Whereas
under Beta8 it worked fine… Is this intentional? If so, this seems
a bit weird that it’s still in __builtins__: >>>
__builtins__.HasAttr <built-in
function HasAttr> Thanks -Lee |
_______________________________________________ users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
