Hello,
I recently ran into some issues with IronPython's heapq implementation
whereby code that functions correctly on CPython failed with IronPython 2.6.
The issue is that the CPython implementation of heapq only calls __le__()
and __eq__() on the heap elements whereas the IronPython
[mailto:users-boun...@lists.ironpython.com] On Behalf Of
Robert Smallshire
Sent: Thursday, August 06, 2009 1:53 PM
To: 'Michael Foord'; 'Discussion of IronPython'
Subject: Re: [IronPython] Reflection.Emit from IronPython:
What is the equivalent of typeof() in C# ?
Hi Michael,
I'm
message and doesn't
work. Prompted by your first sentence I've also tried simply,
generator.Emit(OpCodes.Newarr, System.String)
but I'm still getting RuntimeType[] rather than String[] in the generated
IL.
Thanks,
Rob
Robert Smallshire wrote:
Hello,
I'm attempting to drive
by prematurely
rejecting your answers before I'd got my act together. It seems there are
many equivalents of C# typeof in IronPython.
Thanks,
Rob
-Original Message-
From: users-boun...@lists.ironpython.com
[mailto:users-boun...@lists.ironpython.com] On Behalf Of
Robert Smallshire
Sent
())
generator.Emit(OpCodes.Newarr, System.String().GetType())
generator.Emit(OpCodes.Newarr, clr.GetClrType(System.String))
however, all of these result in RuntimeType[] rather than String[] in the
generated CIL.
How do I get typeof(System.String) from IronPython?
Rob
Robert Smallshire
rob
clr.GetClrType('') ? (on an instance of a string)
Michael
Robert Smallshire wrote:
Hello,
I'm attempting to drive the Reflection.Emit API from
IronPython. In C#
typical Reflection.Emit use makes use typeof(...) facility
in C#, to
enable the determination of types without needing
' in IronPython into a
'bytes' instance in IronPython that will be byte-compatible with what I'm
getting from CPython?
Many thanks,
Rob
Robert Smallshire
from home on behalf of
Roxar Software Solutions
Currently in Norway (UTC +1 hours)
___
Users mailing
Hi Michael,
I'm trying to get some commercial code for a simple object
database we
have written for Python 2.6 to work with IronPython 2.6. In
Python 2.6
the return type of pickle.dumps() is str, which is of course a byte
string. In IronPython 2.6 it is also str, which is of
Hi Michael,
[snip]
My opening paragraph may be ambiguously worded - by
'interoperability'
I didn't mean the ability to run the same code unchanged on CPython
and IronPython (I have to change the code anyway to use a different
database
adapter) - I meant interoperability between
Hello,
Lets create a bytes instance from a str, and convert it back to a str.
a = bytes(ord(c) for c in Hello World)
a
b'Hello World'
str(a)
b'Hello World'
As you can see, the leading b and the quotes become part of the string,
which is unexpected. I guess the conversion is using __repr__
Michael,
Michael Foord wrote:
[snip...]
Here is an example of getting a byte array from a binary pickle in
IronPython:
import pickle
class A(object):
... b = 'hello'
... c = (None, 'fish', 7.2, 7j)
... a = {1: 2}
...
p = pickle.dumps(A(), protocol=2)
p
11 matches
Mail list logo