Re: [IronPython] Learning IronPython?

2006-05-19 Thread Michael Foord
Lesley & Mitch Barnett wrote:
>
> Hello,
>
> I am sure this question has been answered before, but I can’t find the 
> answer... I am a C# programmer and have been using MS technologies 
> since 1991.
>
> However, I know little about IronPython. Can anyone suggest any books 
> or reading material to get me up to speed ASAP? Is there anything 
> special about IronPython that is different than Python?
>
IronPython almost has full Python 2.4 compliance, so it is not very 
different from Python at all.

In addition 'translating' MSDN docs for use with IronPython is quite easy.

At ResolverSystems we are building a full desktop application using 
IronPython and encountering very few difficulties. The only .NET 
functionality we have found that isn't exposed to IronPython (for which 
we have had to use C#) are a few parts needed for our functional tests. 
Only our program launcher uses C# in our production code.

This means you should find it easy to interface .NET code to IronPython. 
There are possibly some limitations that I haven't yet found. For 
example, I believe it is not yet possible to compile Python scripts.

If you have specific Python questions then comp.lang.python is a good 
place to ask :

http://groups.google.com/group/comp.lang.python?hl=en

For a good introduction to Python, the following online book is often 
recommended :

http://diveintopython.org/

For IronPython questions and Python-.NET interaction questions, this is 
a good forum to ask.

Hopefully in the next few days I will do a brief tutorial on using 
Windows Forms with IronPython. It will only show the basics, but that 
ought to be enough to show how to read the MSDN docs from a Python 
perspective.

All the best,

Fuzzyman
http://www.resolversytems.com
http://www.voidspace.org.uk/python/weblog/index.shtml
>
> I have downloaded the latest IronPython Beta and went through the 
> tutorial and have also been through the April VSSDK examples to a 
> certain degree.
>
> Sorry if this is a repeat question.
>
> Regards,
>
> Mitch
>
> http://softwareindustrialization.com 
> 
>
> 
>
> ___
> users mailing list
> users@lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>   

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] Learning IronPython?

2006-05-19 Thread Lesley & Mitch Barnett








Hello,

 

I am sure this question has been answered before, but I can’t
find the answer...  I am a C# programmer and have been using MS technologies
since 1991.

 

However, I know little about IronPython.  Can anyone suggest
any books or reading material to get me up to speed ASAP?  Is there anything
special about IronPython that is different than Python?

 

I have downloaded the latest IronPython Beta and went
through the tutorial and have also been through the April VSSDK examples to a
certain degree.

 

Sorry if this is a repeat question.

 

Regards,

 

Mitch

http://softwareindustrialization.com

 






___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] from xml import xpath

2006-05-19 Thread Greg Lee



I looked at the .c 
for the likely PYD, and it's not playing tricks with the paths---I think the 
problem is simply IP's not supporting PYD format. 
 
If IP can't import 
from PYD format, perhaps it could throw an exception that identifies 
the offending pyd rather than just identifying the original import 
statement, which in this case is five levels up.  That's the only 
improvement in user experience that's warranted.
Writing an xpath wrapper around 
System.Xml.Xpath is not a good use of anyone's time now and probably a dead-end in the 
long-term.
 -Original Message-From: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]On Behalf Of Dino 
ViehlandSent: Friday, May 19, 2006 10:26 AMTo: Discussion 
of IronPythonSubject: Re: [IronPython] from xml import 
xpath

  
  This is probably 
  really tough to do – in order to know the PYD is playing tricks we’d need to 
  support using the PYD, and then it’s not a problem anymore.  I’ll open a 
  bug on this anyway to see if we can make the experience better, but I have no 
  idea what sort of time frame we’d be able to do this in (another option for us 
  would be to create an xpath wrapper around System.Xml.XPath which looks like 
  pyxml, but it’d not solve any larger problems around PYDs in 
  general).
   
  
  Do 
  you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038)
  
  
  
  
  From: 
  [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
  On Behalf Of Greg 
  LeeSent: Friday, May 19, 
  2006 10:18 AMTo: Discussion 
  of IronPythonSubject: Re: 
  [IronPython] from xml import xpath
   
  
  Is a better 
  diagnostic message possible?  This would let us distinguish a pyd problem 
  from "playing tricks with paths", and presumably there might be some value in 
  fixing any problems in the latter.
  
-Original 
Message-From: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]On Behalf Of Dino ViehlandSent: Wednesday, May 17, 2006 11:50 
AMTo: Discussion of 
IronPythonSubject: Re: 
[IronPython] from xml import xpath
You’re right, I did 
miss that…  Looking at this page: http://pyxml.sourceforge.net/topics/howto/section-install.html  
It would seem that you may be right about the Pyd’s (it at least requires a 
C compiler, making that likely – and almost guaranteeing it won’t work w/ 
IronPython).
 
Unfortunately we 
don’t support PYD’s currently (and aren’t likely to soon) so most likely 
this won’t currently work. If you absolutely need XPath support in the mean 
time I’d suggest using .NET’s XMLPath (and if you need to work on both you 
could make a thin wrapper over either PyXml for CPython and .NET’s XPath 
support).  For example:
 
import 
clr
clr.AddReference(‘System.Xml’)
import 
System.Xml.XPath as XPath
 
xpathDoc = 
XPath.XPathDocument(‘file://foo.txt’)
 
 
 

Do 
you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038)




From: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Simon 
DahlbackaSent: Wednesday, 
May 17, 2006 11:41 AMTo: 
Discussion of IronPythonSubject: Re: [IronPython] from xml 
import xpath
 
Dino, you seemed to have missed the 
part about pyxml..It works in cpython with pyxml installed. However, 
pyxml is playing tricks with paths etc, and there might even be pyd:s 
involved..C:\Python24>python.exe Python 2.4.1 (#65, Mar 30 
2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32Type "help", 
"copyright", "credits" or "license" for more information.>>> 
import xml >>> 
xml.__file__'C:\\Python24\\lib\\site-packages\\_xmlplus\\__init__.pyc'>>> 
from xml import xpath>>>

On 5/17/06, Dino Viehland <[EMAIL PROTECTED]> 
wrote:



This doesn't work 
for my in CPython 2.4 either, so I think the docs are 
wrong:

 
>>> from 
xml import xpath
Traceback (most 
recent call last):

  File 
"", line 1, in ?
ImportError: cannot 
import name xpath
>>> import 
sys
>>> 
sys.version
'2.4.2 (#67, Sep 28 
2005, 12:41:11) [MSC v.1310 32 bit (Intel)]'
>>> 
 

Do you want to help develop Dynamic languages on CLR? 
( 
http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038)




From: [EMAIL PROTECTED] [mailto: 
[EMAIL PROTECTED]] On Behalf Of Greg LeeSent: Tuesday, May 16, 2006 3:17 
PMTo: users@lists.ironpython.comSubject: [IronPython] from xml import 
xpath

 
I'm porting an application that 
uses PyXML.  The following from the PyXml documentation http://pyxml.sourceforge.net/topics/howto/section-XPath.html 
doesn't w

Re: [IronPython] from xml import xpath

2006-05-19 Thread Simon Dahlbacka
Re pyd:s playing tricks..In this case it's not any pyd:s that is playing tricks but C:\Python24\Lib\xml\__init__.py :_MINIMUM_XMLPLUS_VERSION = (0, 8, 4)
try:
    import _xmlplusexcept ImportError:
    passelse:
    try:    v = _xmlplus.version_info
    except AttributeError:    # _xmlplus is too old; ignore it
    pass
    else:    if v >= _MINIMUM_XMLPLUS_VERSION:
    import sys    sys.modules[__name__] = _xmlplus
    else:    del v
(PyXML installs itself as _xmplus)On 5/19/06, Dino Viehland <[EMAIL PROTECTED]
> wrote:













This is probably really tough to do –
in order to know the PYD is playing tricks we'd need to support using the
PYD, and then it's not a problem anymore.  I'll open a bug on this
anyway to see if we can make the experience better, but I have no idea what sort
of time frame we'd be able to do this in (another option for us would be
to create an xpath wrapper around System.Xml.XPath which looks like pyxml, but
it'd not solve any larger problems around PYDs in general).

 




Do
you want to help develop Dynamic languages on CLR? (
http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038)











From:
[EMAIL PROTECTED] [mailto:
[EMAIL PROTECTED]] On Behalf Of Greg Lee
Sent: Friday, May 19, 2006 10:18
AM
To: Discussion of IronPython
Subject: Re: [IronPython] from xml
import xpath



 



Is a better diagnostic message
possible?  This would let us distinguish a pyd problem from "playing
tricks with paths", and presumably there might be some value in fixing any
problems in the latter.





-Original Message-
From:
[EMAIL PROTECTED] [mailto:
[EMAIL PROTECTED]]On Behalf Of Dino Viehland
Sent: Wednesday, May 17, 2006
11:50 AM
To: Discussion of IronPython
Subject: Re: [IronPython] from xml
import xpath

You're right, I did miss
that…  Looking at this page: http://pyxml.sourceforge.net/topics/howto/section-install.html
 
It would seem that you may be right about the Pyd's (it at least requires
a C compiler, making that likely – and almost guaranteeing it won't
work w/ IronPython).

 

Unfortunately we don't support
PYD's currently (and aren't likely to soon) so most likely this
won't currently work. If you absolutely need XPath support in the mean
time I'd suggest using .NET's XMLPath (and if you need to work on
both you could make a thin wrapper over either PyXml for CPython and
.NET's XPath support).  For example:

 

import clr

clr.AddReference('System.Xml')

import System.Xml.XPath as XPath

 

xpathDoc =
XPath.XPathDocument('file://foo.txt')

 

 

 




Do
you want to help develop Dynamic languages on CLR? (
http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038)











From:
[EMAIL PROTECTED] [mailto:
[EMAIL PROTECTED]] On Behalf Of Simon Dahlbacka
Sent: Wednesday, May 17, 2006
11:41 AM
To: Discussion of IronPython
Subject: Re: [IronPython] from xml
import xpath



 

Dino, you seemed to have
missed the part about pyxml..

It works in cpython with pyxml installed. However, pyxml is playing tricks with
paths etc, and there might even be pyd:s involved..

C:\Python24>python.exe 
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or
"license" for more information.
>>> import xml 
>>> xml.__file__
'C:\\Python24\\lib\\site-packages\\_xmlplus\\__init__.pyc'
>>> from xml import xpath
>>>



On 5/17/06, Dino
Viehland <[EMAIL PROTECTED]>
wrote:







This doesn't work for my in CPython 2.4 either, so I think
the docs are wrong:





 

>>> from xml import xpath

Traceback (most recent call last):





  File "", line 1, in ?

ImportError: cannot import name xpath

>>> import sys

>>> sys.version

'2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit
(Intel)]'

>>> 

 




Do you want to help develop Dynamic languages on CLR? (

http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038)











From: 
[EMAIL PROTECTED]
[mailto:
[EMAIL PROTECTED]] On
Behalf Of Greg Lee
Sent: Tuesday, May 16, 2006 3:17
PM
To: users@lists.ironpython.com
Subject: [IronPython] from xml
import xpath







 

I'm
porting an application that uses PyXML.  The following from the PyXml
documentation http://pyxml.sourceforge.net/topics/howto/section-XPath.html

doesn't work:

from xml import xpath 
Traceback
(most recent call last): 
 
File , line 0, in input##113 
ImportError:
cannot import xpath from xml 

Any
suggestions?  I messed around with adding site-packages to IRONPYTHONPATH
but other BadThings happened. 

Here's
the installation: 

Microsoft Windows XP [Version 5.1.2600]
IronPython 1.0.60420 (Beta) on .NET 2.0.50727.42

python 2.4.2
pyxml 0.8.4
pywin32 205
py2exe 0.6.3

IRONPYTHONPATH = c:\python24\lib 










___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-

Re: [IronPython] from xml import xpath

2006-05-19 Thread Dino Viehland








This is probably really tough to do –
in order to know the PYD is playing tricks we’d need to support using the
PYD, and then it’s not a problem anymore.  I’ll open a bug on this
anyway to see if we can make the experience better, but I have no idea what sort
of time frame we’d be able to do this in (another option for us would be
to create an xpath wrapper around System.Xml.XPath which looks like pyxml, but
it’d not solve any larger problems around PYDs in general).

 



Do
you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038)











From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Greg Lee
Sent: Friday, May 19, 2006 10:18
AM
To: Discussion of IronPython
Subject: Re: [IronPython] from xml
import xpath



 



Is a better diagnostic message
possible?  This would let us distinguish a pyd problem from "playing
tricks with paths", and presumably there might be some value in fixing any
problems in the latter.





-Original Message-
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Dino Viehland
Sent: Wednesday, May 17, 2006
11:50 AM
To: Discussion of IronPython
Subject: Re: [IronPython] from xml
import xpath

You’re right, I did miss
that…  Looking at this page: http://pyxml.sourceforge.net/topics/howto/section-install.html 
It would seem that you may be right about the Pyd’s (it at least requires
a C compiler, making that likely – and almost guaranteeing it won’t
work w/ IronPython).

 

Unfortunately we don’t support
PYD’s currently (and aren’t likely to soon) so most likely this
won’t currently work. If you absolutely need XPath support in the mean
time I’d suggest using .NET’s XMLPath (and if you need to work on
both you could make a thin wrapper over either PyXml for CPython and
.NET’s XPath support).  For example:

 

import clr

clr.AddReference(‘System.Xml’)

import System.Xml.XPath as XPath

 

xpathDoc =
XPath.XPathDocument(‘file://foo.txt’)

 

 

 



Do
you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038)











From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Simon Dahlbacka
Sent: Wednesday, May 17, 2006
11:41 AM
To: Discussion of IronPython
Subject: Re: [IronPython] from xml
import xpath



 

Dino, you seemed to have
missed the part about pyxml..

It works in cpython with pyxml installed. However, pyxml is playing tricks with
paths etc, and there might even be pyd:s involved..

C:\Python24>python.exe 
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or
"license" for more information.
>>> import xml 
>>> xml.__file__
'C:\\Python24\\lib\\site-packages\\_xmlplus\\__init__.pyc'
>>> from xml import xpath
>>>



On 5/17/06, Dino
Viehland <[EMAIL PROTECTED]>
wrote:







This doesn't work for my in CPython 2.4 either, so I think
the docs are wrong:





 

>>> from xml import xpath

Traceback (most recent call last):





  File "", line 1, in ?

ImportError: cannot import name xpath

>>> import sys

>>> sys.version

'2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit
(Intel)]'

>>> 

 



Do you want to help develop Dynamic languages on CLR? (
http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038)











From: [EMAIL PROTECTED]
[mailto:
[EMAIL PROTECTED]] On
Behalf Of Greg Lee
Sent: Tuesday, May 16, 2006 3:17
PM
To: users@lists.ironpython.com
Subject: [IronPython] from xml
import xpath







 

I'm
porting an application that uses PyXML.  The following from the PyXml
documentation http://pyxml.sourceforge.net/topics/howto/section-XPath.html
doesn't work:

from xml import xpath 
Traceback
(most recent call last): 
 
File , line 0, in input##113 
ImportError:
cannot import xpath from xml 

Any
suggestions?  I messed around with adding site-packages to IRONPYTHONPATH
but other BadThings happened. 

Here's
the installation: 

Microsoft Windows XP [Version 5.1.2600]
IronPython 1.0.60420 (Beta) on .NET 2.0.50727.42

python 2.4.2
pyxml 0.8.4
pywin32 205
py2exe 0.6.3

IRONPYTHONPATH = c:\python24\lib 










___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



 








___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] IronPython on the Compact .NET Framework

2006-05-19 Thread Dino Viehland
As far as beta 7, while I mentioned earlier this week it'd probably come out 
this week, it looks like we're going to let it slide into early next week to 
get a few extra bug fixes in and then make sure things are stable.

Do you want to help develop Dynamic languages on CLR? 
(http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038)

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Foord
Sent: Friday, May 19, 2006 2:28 AM
To: Discussion of IronPython
Subject: [IronPython] IronPython on the Compact .NET Framework

Hello all,

I realise this has been discussed on the mailing list several times before.

Just to add that I (as an individual) and the company I work for
(ResolverSystems) would be very interested in seeing IronPython for the
.NET compact framework, were that to become possible. :-)

Any word on Beta 7 by the way ?

All the best,


Michael Foord
http://www.resolversystems.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] from xml import xpath

2006-05-19 Thread Greg Lee



Is a 
better diagnostic message possible?  This would let us distinguish a pyd 
problem from "playing tricks with paths", and presumably there might be some 
value in fixing any problems in the latter.

  -Original Message-From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]On Behalf Of Dino 
  ViehlandSent: Wednesday, May 17, 2006 11:50 AMTo: 
  Discussion of IronPythonSubject: Re: [IronPython] from xml import 
  xpath
  
  You’re right, I did 
  miss that…  Looking at this page: http://pyxml.sourceforge.net/topics/howto/section-install.html  
  It would seem that you may be right about the Pyd’s (it at least requires a C 
  compiler, making that likely – and almost guaranteeing it won’t work w/ 
  IronPython).
   
  Unfortunately we 
  don’t support PYD’s currently (and aren’t likely to soon) so most likely this 
  won’t currently work. If you absolutely need XPath support in the mean time 
  I’d suggest using .NET’s XMLPath (and if you need to work on both you could 
  make a thin wrapper over either PyXml for CPython and .NET’s XPath 
  support).  For example:
   
  import 
  clr
  clr.AddReference(‘System.Xml’)
  import 
  System.Xml.XPath as XPath
   
  xpathDoc = 
  XPath.XPathDocument(‘file://foo.txt’)
   
   
   
  
  Do 
  you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038)
  
  
  
  
  From: 
  [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
  On Behalf Of Simon 
  DahlbackaSent: Wednesday, 
  May 17, 2006 11:41 AMTo: 
  Discussion of IronPythonSubject: Re: [IronPython] from xml import 
  xpath
   
  Dino, you seemed to have missed the part 
  about pyxml..It works in cpython with pyxml installed. However, pyxml 
  is playing tricks with paths etc, and there might even be pyd:s 
  involved..C:\Python24>python.exe Python 2.4.1 (#65, Mar 30 
  2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32Type "help", 
  "copyright", "credits" or "license" for more information.>>> 
  import xml >>> 
  xml.__file__'C:\\Python24\\lib\\site-packages\\_xmlplus\\__init__.pyc'>>> 
  from xml import xpath>>>
  
  On 5/17/06, Dino Viehland <[EMAIL PROTECTED]> 
  wrote:
  
  
  
  This doesn't work for 
  my in CPython 2.4 either, so I think the docs are 
  wrong:
  
   
  >>> from xml 
  import xpath
  Traceback (most 
  recent call last):
  
    File 
  "", line 1, in ?
  ImportError: cannot 
  import name xpath
  >>> import 
  sys
  >>> 
  sys.version
  '2.4.2 (#67, Sep 28 
  2005, 12:41:11) [MSC v.1310 32 bit (Intel)]'
  >>> 
   
  
  Do you want to help develop Dynamic languages on CLR? 
  ( 
  http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038)
  
  
  
  
  From: [EMAIL PROTECTED] [mailto: 
  [EMAIL PROTECTED]] On 
  Behalf Of Greg LeeSent: Tuesday, May 16, 2006 3:17 
  PMTo: users@lists.ironpython.comSubject: [IronPython] from xml import 
  xpath
  
   
  I'm porting an application that 
  uses PyXML.  The following from the PyXml documentation http://pyxml.sourceforge.net/topics/howto/section-XPath.html 
  doesn't work:
  from xml import 
  xpath Traceback (most recent 
  call last):   File , line 0, in 
  input##113 ImportError: cannot import 
  xpath from xml 
  Any suggestions?  I messed 
  around with adding site-packages to IRONPYTHONPATH but other BadThings 
  happened. 
  Here's the 
  installation: 
  Microsoft Windows XP 
  [Version 5.1.2600]IronPython 1.0.60420 (Beta) on .NET 
  2.0.50727.42python 2.4.2pyxml 0.8.4pywin32 205py2exe 
  0.6.3IRONPYTHONPATH = c:\python24\lib 
  
  ___users 
  mailing listusers@lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com
   
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Dict iteration inconsistency?

2006-05-19 Thread Dino Viehland








But we probably shouldn’t be
throwing an exception here if CPython isn’t… I’ve opened a bug
on this.

 



Do
you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038)











From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Simon Dahlbacka
Sent: Friday, May 19, 2006 9:20 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Dict
iteration inconsistency?



 

They don't do the same
thing..
fragment 1 iterates over a *copy* of the dictionarys keys, while fragment 2
iterates over the dictionary



On 5/19/06, J. de
Hooge <[EMAIL PROTECTED]>
wrote:

LS

Following code fragments seem to behave inconsistently 

[START OF CODE]

# --- Fragment 1
#
#   Accepted by CPython
#
#   Accepted by IronPython1.0 B6

dictionary = dict (zip (range (10), range (0, 100, 10)))

print dictionary

for key in dictionary.keys ():
dictionary [key] = 100 * key

print dictionary

# --- Fragment 2: IronPython objects to the following, CPython thinks its OK
#
#   Accepted by CPython
#
#   Rejected by IronPython1.0 B6:
#  
Traceback (most recent call last):
#  
File C:\activ_dell\prog\qQuick\try\try.py, line 29, in
Initialize
#  
RuntimeError: dictionary changed size during iteration 

dictionary = dict (zip (range (10), range (0, 100, 10)))

print dictionary

for key in dictionary:
dictionary [key] = 100 * key

print dictionary

# --- Shouldn't fragments 1 and 2 be both rejected or both accepted by 
IronPython?

[END OF CODE]


Kind regards,
Jacques de Hooge
[EMAIL PROTECTED]


___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



 






___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] IronPython on the Compact .NET Framework

2006-05-19 Thread Haibo Luo
Currently .NET compact framework does not support DynamicMethod (among other 
features), which is widely used in current IronPython implementation.

We will contact .NET CF team for this feature request.

Thanks!

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Foord
Sent: Friday, May 19, 2006 2:28 AM
To: Discussion of IronPython
Subject: [IronPython] IronPython on the Compact .NET Framework

Hello all,

I realise this has been discussed on the mailing list several times before.

Just to add that I (as an individual) and the company I work for
(ResolverSystems) would be very interested in seeing IronPython for the
.NET compact framework, were that to become possible. :-)

Any word on Beta 7 by the way ?

All the best,


Michael Foord
http://www.resolversystems.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] default contructor allows parameters

2006-05-19 Thread Haibo Luo
Thanks for the bug report. We are aware of this issue, will fix it before 1.0 
RTM.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andrzej Krzywda
Sent: Friday, May 19, 2006 3:25 AM
To: users@lists.ironpython.com
Subject: [IronPython] default contructor allows parameters

Hi all,

It seems that IronPython is allowing parameters to the default
constructor but CPython isn't.


CPython

 >>> class Foo(object):
... pass
...
 >>> Foo(5)
Traceback (most recent call last):
  File "", line 1, in ?
TypeError: default __new__ takes no parameters
 >>>

IronPython Beta 6

 >>> class Foo(object):
... pass
...
 >>> Foo(5)

 >>>

Regards,
Andrzej Krzywda
http://www.resolversystems.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Dict iteration inconsistency?

2006-05-19 Thread Simon Dahlbacka
They don't do the same thing..fragment 1 iterates over a *copy* of the dictionarys keys, while fragment 2 iterates over the dictionaryOn 5/19/06, J. de  Hooge
 <[EMAIL PROTECTED]> wrote:LSFollowing code fragments seem to behave inconsistently
[START OF CODE]# --- Fragment 1##   Accepted by CPython##   Accepted by IronPython1.0 B6dictionary = dict (zip (range (10), range (0, 100, 10)))print dictionary
for key in dictionary.keys ():dictionary [key] = 100 * keyprint dictionary# --- Fragment 2: IronPython objects to the following, CPython thinks its OK##   Accepted by CPython#
#   Rejected by IronPython1.0 B6:#   Traceback (most recent call last):#   File C:\activ_dell\prog\qQuick\try\try.py, line 29, inInitialize#   RuntimeError: dictionary changed size during iteration
dictionary = dict (zip (range (10), range (0, 100, 10)))print dictionaryfor key in dictionary:dictionary [key] = 100 * keyprint dictionary# --- Shouldn't fragments 1 and 2 be both rejected or both accepted by
IronPython?[END OF CODE]Kind regards,Jacques de Hooge[EMAIL PROTECTED]___users mailing list
users@lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] Dict iteration inconsistency?

2006-05-19 Thread J. de Hooge
LS

Following code fragments seem to behave inconsistently

[START OF CODE]

# --- Fragment 1
#
#   Accepted by CPython
#
#   Accepted by IronPython1.0 B6

dictionary = dict (zip (range (10), range (0, 100, 10)))

print dictionary

for key in dictionary.keys ():
dictionary [key] = 100 * key

print dictionary

# --- Fragment 2: IronPython objects to the following, CPython thinks its OK
#
#   Accepted by CPython
#
#   Rejected by IronPython1.0 B6:
#   Traceback (most recent call last):
#   File C:\activ_dell\prog\qQuick\try\try.py, line 29, in
Initialize
#   RuntimeError: dictionary changed size during iteration

dictionary = dict (zip (range (10), range (0, 100, 10)))

print dictionary

for key in dictionary:
dictionary [key] = 100 * key

print dictionary

# --- Shouldn't fragments 1 and 2 be both rejected or both accepted by
IronPython?

[END OF CODE]


Kind regards,
Jacques de Hooge
[EMAIL PROTECTED]


___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] default contructor allows parameters

2006-05-19 Thread Andrzej Krzywda
Hi all,

It seems that IronPython is allowing parameters to the default 
constructor but CPython isn't.


CPython

 >>> class Foo(object):
... pass
...
 >>> Foo(5)
Traceback (most recent call last):
  File "", line 1, in ?
TypeError: default __new__ takes no parameters
 >>>

IronPython Beta 6

 >>> class Foo(object):
... pass
...
 >>> Foo(5)

 >>>

Regards,
Andrzej Krzywda
http://www.resolversystems.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] IronPython on the Compact .NET Framework

2006-05-19 Thread Michael Foord
Hello all,

I realise this has been discussed on the mailing list several times before.

Just to add that I (as an individual) and the company I work for 
(ResolverSystems) would be very interested in seeing IronPython for the 
.NET compact framework, were that to become possible. :-)

Any word on Beta 7 by the way ?

All the best,


Michael Foord
http://www.resolversystems.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com