[IronPython] true division?

John Machin sjmachin at lexicon.net
Fri Sep 22 02:46:31 CEST 2006


On 22/09/2006 10:15 AM, Gary Stephenson wrote:
> Aha!  Many thanks John.
> 
> It would appear that there is indeed something of an unwritten law in 
> operation regarding IronPython, going something like:
> 
>     "thou shalt always ensure that the CPython Lib be included on thine 
> sys.path"
> 

No, not at all, only if you need it, and then beware that it can mask 
differences between CPython and IronPython.

The difference in this case is that IronPython has special-cased the 
"from __future__ import whatever" caper -- there is no module called 
__future__ in IronPython. Note the different error messages below:

| >>> from __future__ import somerubbish
| Traceback (most recent call last):
| SyntaxError: future feature is not defined: somerubbish (<stdin>, line 1)
| >>> from sys import somerubbish
| Traceback (most recent call last):
|  File , line 0, in <stdin>##13
| ImportError: Cannot import name somerubbish
| >>>

HTH,
John



More information about the Ironpython-users mailing list