[IronPython] IronPython 1.0.1 Released!

Dave Fugate dfugate at microsoft.com
Wed Oct 11 19:06:13 CEST 2006


A quicker way to tell if you're using IP 1.0 or 1.0.1 is to use the following:
        import sys
        ip_11 = hasattr(sys, "winver")

(The "winver" global was introduced with 1.0.1 to close a Codeplex bug.)

This is not a permanent solution either though and will only work between IP 1.0 and 1.0.1


-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly
Sent: Wednesday, October 11, 2006 8:35 AM
To: Discussion of IronPython
Subject: Re: [IronPython] IronPython 1.0.1 Released!

I am sorry, this is a simple miscommunication. I am not suggesting that this is (and always will be) the way to check for IronPython's version. I only provided this temporary solution for people who absolutely must be able to tell the difference between 1.0 and 1.0.1 for simply there is no other good way to tell at this point. Of course, apart from making this (I admit not ideal) solution available now, we must find something better, something which will fit nicely with the Python model of providing version information. The script below, or probably looking for substrings in sys.version:

1.0: sys.version == 'IronPython 1.0.60816 on .NET 2.0.50727.42'
1.0.1: sys.version == 'IronPython 1.0 (1.0.61005.1977) on .NET 2.0.50727.42'

are just about the only way to tell (for now) between 1.0 and 1.0.1. Note that our sys.version_info reports (2, 4, 0, 'final', 0) to express compatibility with CPython 2.4) and that in the absence of sys.subversion. We can certainly add the sys.subversion in the nearest release, but it will be solution going forward, unfortunately not available for 1.0 and 1.0.1 where - sadly - we don't have anything as clean as that available.

Martin

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Anthony Baxter
Sent: Tuesday, October 10, 2006 11:50 PM
To: Discussion of IronPython
Subject: Re: [IronPython] IronPython 1.0.1 Released!

> import System
> a = [].GetType().Assembly.GetCustomAttributes(System.Reflection.AssemblyFileVersionAttribute, False)
> if len(a) > 0:
>     if a[0].Version == "1.0.61005.1977": print "IronPython 1.0.1"
>     else: print "Unknown version"
> else:
>     print "IronPython 1.0"

Er - what? This isn't even close to a good approach. How on earth can
I make code that uses this forward-compatible? Any code I write using
this will need to be updated for IronPython1.1, and whenever there is
a subsequent version.

Please, please at least support sys.subversion to identify the
version. I'm thinking something like
('IronPython', 'tags/1.0.1', '61005') or the like.

CPython 2.5 is currently
('CPython', 'tags/r25', '51908')

Right now, there is no easy way (aside from parsing sys.version) to
say "is this code running on CPython or IronPython." And, as I started
this thread, the format of sys.version changed from 1.0 to 1.0.1.

I'd be open to suggesting some other attribute in sys - but it really
does need to be in sys. If there was something like
"sys.implementation" I could see we could add that to CPython as well.
(But see note below about CPython release schedule)

As far as sys.version_info claiming to be Python 2.4 - I can sort of
understand that from a pragmatic point of view. But it leaves me with
a bad feeling - it's all too similar to almost every http client
identifying themselves as "Mozilla 4.0 (Actual Browser Name Here)".

The basic problem is that the stuff we have now was designed really
for a world where all Python implementations shared a common concept
of "version" - that is, Jython 2.2 is feature-compatible with CPython
2.2. It's possible that needs to be addressed, although given we just
did CPython 2.5, we're not going to be able to change it for CPython
for a good 18 months (the approximate timeframe for a 2.6).

Anthony
_______________________________________________
users mailing list
users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
users mailing list
users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list