At the risk of appearing flippant, I'd like to suggest that the following
should be considered an error in need of correction. <0.5wink>
IronPython 1.0 (1.0.61005.1977) on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
>>> import this
Traceback (most recent call last
Hi John
> 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 la
uot;John Machin" <[EMAIL PROTECTED]>
To: "Discussion of IronPython"
Sent: Friday, September 22, 2006 10:05 AM
Subject: Re: [IronPython] true division?
> On 22/09/2006 8:10 AM, Michael Foord wrote:
>> Gary Stephenson wrote:
>>> Thanks John (and Seo),
>>
mber 22, 2006 8:10 AM
Subject: Re: [IronPython] true division?
> Gary Stephenson wrote:
>> Thanks John (and Seo),
>>
>> When I attempt the same thing I get:
>>
> Of course. The correct syntax is:
>>>> from __future__ import division
>
> ;-)
>
>
n?
> On 21/09/2006 7:27 PM, Sanghyeon Seo wrote:
>> 2006/9/21, Gary Stephenson <[EMAIL PROTECTED]>:
>>> Is there a way to get true division in ipy without using the -Qnew
>>> command
>>> line option? On a per-module or per-instance basis?
>>>
Is there a way to get true division in ipy without using the -Qnew command
line option? On a per-module or per-instance basis?
"from __future__ import true_division"
returns "SyntaxError: future feature is not defined: true_division"
I see in the Issue Tracker for work item 2206 it says
f
d'oh! I knew there must have been a straightforward way.
I'm still curious as to how to use the IronPython.Hosting stuff though, as I
thinkultimately it might prove to be more what I'm really after.
thanks,
gary
> This works for me:
>
> IronPython 1.0.2449 on .NET 2.0.50727.42
> Copyright (
hi,
I confess to being a newbie at this sort of thing in Python or IronPython,
so I'm hoping that there is a simple answer to the subject question.
I started off trying to use standard "compile()" function and "exec"
statement, but was unable to make it work, although I'm sure there must be a
Hi,
The following code works perfectly in CPython, but is all over the shop in
ipy :-( Any ideas on how I might make it work in ipy?
class valueDescriptor(object):
def __init__(self,x=None):
self.value = x
def __get__(self,ob,cls):
return self.value
def __set__(self,
maybe it is a bug, or you can use traceback for simple things but
not printing the stack or maybe it only affects Australians like you
and me.
Regards
Mark
On 9/5/06, Gary Stephenson <[EMAIL PROTECTED]> wrote:
> My third attempt at asking this question (as the previous two went through
> to th
My third attempt at asking this question (as the previous two went through
to the 'keeper) ...
Is the following considered a bug in IronPython, or am I doing something
wrong?
import sys
def test():
try:
raise Exception()
except Exception, oErr:
print sys.exc_info()[2]
I got no response from this the first time, so, at the risk of appearing
rude, I will ask again: How do I get a hold of a Traceback object, or is it
not currently possible?
thanks,
gary
- Original Message -
From: "Gary Stephenson" <[EMAIL PROTECTED]>
To: "Dis
In the release notes for Beta 4 it mentions "Traceback support", but try as
I might I can't seem to get my hands on a Traceback object. Am I doing
something wrong?
thanks in advance,
gary
import sys
def test():
try:
raise Exception()
except Exception, oErr:
print sy
What is the best way to convert a Byte[] to a string?
The best I've been able to come up with is
"".join( [chr(x) for x in bytearr] )
but I just know there are better ways than that - surely ..
thanks in advance,
gary
___
users mailing list
us
I discovered in my playing that ipy allows the following use (abuse?) of
locals():
def test2( dic, nm ):
dic[nm] = 5
def test()
x = 10
test2( locals(), "x" )
print x # prints 5 in ipy and 10 in CPython 2.4
test()
My question is, is this by design? Can it be relied upon, or wi
I would like to adapt the following code to IronPython, but there appears to
be no inspect module available.
Any clues on how I might proceed?
many tias,
gary
# code begins
# a hack to support something like dynamically scoped variables
import inspect
class _gsDynamicVars( object ):
def
16 matches
Mail list logo