[IronPython] Differences between cpython and ironpython

Dino Viehland dinov at exchange.microsoft.com
Thu Nov 16 20:48:30 CET 2006

#1 is (largely) due to compilation time.  I suspect we may look at something around this for v2.0 (for example maybe caching compiled files - which won't make it faster the 1st time, but at least additional times it'll be better).

I've added #2 & #3 to bug 697 (http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=697).

For #4 could you vote for this bug?  http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=2988  With CodePlex's new voting system this is a great way to raise visibility of bugs.

#5) We ran into this one internally recently too.  I've opened bug 5711 http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=5711

#6) I've opened bug 5712 for this one: http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=5712  I'll need to look at this one closer.

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jörgen Stenarson
Sent: Wednesday, November 15, 2006 12:16 PM
To: Discussion of IronPython
Subject: [IronPython] Differences between cpython and ironpython


Sorry my announcement message on the ironpython pyreadline port got the
wrong subject.

This mail contains the differences I found between cpython and
ironpython when working on the pyreadline port.

1) import time is much higher in ironpython than cpython

2) Had to patch source to be able to replace readline function:

in PythonCommandLine.cs change class definition:
   class PythonCommandLine
   public class PythonCommandLine

3) Defaultprompt, in cpython the prompt is printed by readline (it is
passed as a parameter to readline).
    In ironpython the interpreter prints it before calling readline.

4) mode string for open: in cpython does not react to unknown characters
like "rt"=="r"

5) It seems I'm unable to catch KeyboardInterrupts properly. It looks
like the except logic is executed but the KeyboardInterrupt is reraised

6) rlcompleter had to be patched

line 85:
             self.namespace = __main__.__dict__
should read
             self.namespace = __main__.__dict__.copy()
I think it is related to the following difference in behaviour

IronPython 1.0 (1.0) on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
 >>> import __main__
 >>> w=10
 >>> for w in __main__.__dict__:
...      print w
[__name__, __main__]
Traceback (most recent call last):
   File , line 0, in <stdin>##105
   File mscorlib, line unknown, in MoveNext
   File mscorlib, line unknown, in ThrowInvalidOperationException
SystemError: Collection was modified; enumeration operation may not execute.

compared to cpython:
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on
Type "help", "copyright", "credits" or "license" for more information.
 >>> import __main__
 >>> w=10
 >>> for w in __main__.__dict__:
...     print w

users mailing list
users at lists.ironpython.com

More information about the Ironpython-users mailing list