[IronPython] Regression with Beta9?

Lee Culver t-clacul at microsoft.com
Fri Jul 14 19:38:36 CEST 2006


Ah ok...

 

I was more wondering if it's a supported construct or not (and if it is,
why is it missing?).  I would like to use these IronPython specific
names since it makes the code uniform in terms of function
capitalization (and this code could never run in CPython anyway since it
makes heavy use of the .Net platform).

 

Thanks,

Lee

 

________________________________

From: users-bounces at lists.ironpython.com
[mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly
Sent: Friday, July 14, 2006 10:29 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Regression with Beta9?

 

HasAttr is not an IronPython specific construct, just an IronPython
specific name. It is, however, strange, that we don't find it after you
import clr. We'll look into that problem.

 

In the meantime, you can use the name of the true Python built-in
"hasattr". It will execute the very same code, only a different name
will be used to access it. start_new_thread will still work for your
StartNewThread case.

 

Martin

 

________________________________

From: users-bounces at lists.ironpython.com
[mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver
Sent: Friday, July 14, 2006 9:00 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Regression with Beta9?

 

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: users-bounces at lists.ironpython.com
[mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly
Sent: Thursday, July 13, 2006 9:50 PM
To: Discussion of IronPython
Subject: Re: [IronPython] Regression with Beta9?

 

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: users-bounces at lists.ironpython.com
[mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver
Sent: Thursday, July 13, 2006 8:35 PM
To: Discussion of IronPython
Subject: Re: [IronPython] Regression with Beta9?

 

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: users-bounces at lists.ironpython.com
[mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver
Sent: Thursday, July 13, 2006 8:17 PM
To: Discussion of IronPython
Subject: [IronPython] Regression with Beta9?

 

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20060714/53e2efb6/attachment.html>


More information about the Ironpython-users mailing list