Aviad Rozenhek wrote:
what I would like is to expose the DynamicProperties of my class as
actual properties in IP, which is logical since IP is dynamic.
I'm not sure if there is a way you can implement __getattr__ in your C# class
(and have IronPython Do The Right Thing,) but you could do
jeff sacksteder wrote:
errorlevel = board.AIn(channel,mode,output)
TypeError: no overloads of AIn could match (int, Range, int)
AIn(int, Range, Reference[Int16])
AIn(int, Range, Reference[UInt16])
What are the contents of board.AIn.Overloads? This might give you some idea of
why your
v = Vector3(1, 2, 3)
v
...]osoft.DirectX.Vector3 object at 0x002C [Z : 3
Huh?
--
Jonathan
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Nathan R. Ernst wrote:
Out of curiosity, is there any sort of hook into the engine that would allow
you search for a module on your own? e.g. a search of sys.path did not find
I'm not sure how well this is going to work with IronPython, but in CPython
you're advised to use ihooks
Kevin Bjorke wrote:
I need to create a list of Singles to use
System.Drawing.Darwing2D.ColorBlend's Position member. Color me
ignorant, but how can I create such a thing? I can't just pass a list of
floats
It would be convenient to pass a tuple of floats, too bad this doesn't work.
You can
Cheemeng wrote:
the doc for ToolStripItemCollection.AddRange list the 2 overloads as:
ToolStripItemCollection.AddRange (ToolStripItem[])
ToolStripItemCollection.AddRange (ToolStripItemCollection)
in prev ironpython version, we can pass a python list as argument,
in the newest version, this
Hi,
(I didn't see any of these things on the CodePlex issue tracker, sorry if
these are old news.)
Trying to define a class that derives from my .NET object, with a single
constructor that takes more than 4 arguments, explodes:
Test.cs:
public class Test {
public Test(int a, int b, int
Hi,
I'm wondering how to call a specific overload, more specifically one that in
C# would take an out parameter but in IronPython does/can not.
Here are the available overloads:
print Direct3D.Mesh.FromFile.__doc__
static (Mesh, array_EffectInstance) FromFile(str filename, MeshFlags options,
Jonathan Jacobs wrote:
Direct3D.Mesh.FromFile.__overloads__[(str, Direct3D.MeshFlags,
Direct3D.Device, clr.GetClrType(Direct3D.ExtendedMaterial).MakeArrayType())]
Traceback (most recent call last):
File , line 0, in stdin##22
File , line 0, in get_Item##18
TypeError: No match found
Jonathan Jacobs wrote:
I did some digging in the source code, it looks like the problem is the
indexer for BuiltinFunctionOverloadMapper. The problem appears to be: from
Python I am unable to specify whether an argument is byref or not and so the
comparison fails when trying to match
Dino Viehland wrote:
To get a better stack trace I would suggest you run w/ -X:ExceptionDetail
command line option which will give you the raw exception info thrown by
the CLR. By default we exclude all of the IronPython, mscorlib, etc...
frames and just give you the frames that you presumably
Sanghyeon Seo wrote:
Currently help() raises NotImplementedError.
But in the mean time, I would like to have help(obj) as an equivalent
to print obj.__doc__. It's not like CPython's help(), but it is
certainly more useful than the current behaviour.
I was going to suggest using pydoc.help
(Please disregard any earlier message about this, I think I might have pressed
Send accidentally.)
Hi,
I ran across some interesting behaviour today.
Short version:
I have a handful of Direct3D.Mesh objects (courtesy of Direct3D.Mesh.Teapot)
which I render using
Neville Bagnall wrote:
FWIW in the general case I would have something equivalent to:
def GenRepr(object):
strrep=object.ToString()
if len(strrep)40 and strrep.find('\n')==-1:
return %s: %s % (object.__class__.__name__, repr(strrep)[1:-1])
else:
return %s
Hi,
In all the cases I've seen, calling repr on a .NET type ends up calling
ToString which is generally reasonably useful but almost always unnecessarily
verbose. Sometimes it would be nice if it gave you something a little more
specific about the object in question, something less like:
v
Nicholas Bastin wrote:
No, actually it doesn't. The string returned by __repr__ should be
able to be used to re-create the object, if that is possible. In
this case, 'X: 0\nY: 0\nZ: 0\n' is a *lot* closer to re-creating the
object than 'Foo object at 0x002B' is. The
Nicholas Bastin wrote:
Generally we try to meet in the middle on __repr__ - in many cases,
it's most convenient if the output from __repr__ can be fed back into
a factory or constructor for the class the text came from, so that
the following expression is legal:
new_object =
Dino Viehland wrote:
There's a bug in beta 5 and beta 6 where we can sometimes fail to call the
correct derived method. You can work around the bug in many cases w/:
Class MyForm(Form):
def __init__(self):
self.OnKeyUp = self.OnKeyUp
def OnKeyUp(self, e):
J. Merrill wrote:
In C# you could use Vector3.Unprojectbut that might not work in IP.
Have you tried it?
I guess I neglected to mention the part where I explained what I was doing. :)
Calling Vector3.Unproject (in an attempt to call the static method) results in
a None return value,
Simon Dahlbacka wrote:
I suppose the problem is that the following is valid (and even used)
python code
Quite right.
Btw, why do you need both a static and a non-static method with the same
name?
Well, it's not my code, it's from the Managed DirectX API.
--
Jonathan
Hi, me again!
I realise the error seems logical enough, but it isn't right. The
documentation for Vector3 specifies that the fields X, Y and Z are all
read/write and indeed C# code has no boggle doing just that.
Vector3.GetType().IsValueType is true; I guess relying on IsValueType isn't
Sanghyeon Seo wrote:
Have you read this?
http://channel9.msdn.com/wiki/default.aspx/IronPython.ValueTypes
As far as I understand the Vector3 type: it is a struct with public fields,
are these subject to these quirks too? One wouldn't expect structs to need
getters and setters that somewhat
Kevin Bjorke wrote:
We are:
http://developer.nvidia.com/object/fx-composer2-pipeline-gdc-2006.html
That is a pretty awesome looking piece of software, Kevin!
--
Jonathan
___
users mailing list
users@lists.ironpython.com
Hi,
I'm wondering how I override methods in a derived object, I'm not sure
whether this is the problem I'm experiencing or not but it looks that way.
Defining my own form object, with OnKeyUp method:
class MyForm(Form):
... def OnKeyUp(self, e):
... print '!!!'
...
Gardner Pomper wrote:
Hi,
I am trying to manipulate mappoint from an IronPython script. I tried to
do the COM integration I found in the Tutorial, but it failed. I have
copied what I did into this email. Can someone take a look and tell me
what I should have done?
I believe the problem
Hi,
I've stumbled across this interesting behaviour:
p = ((1, 2),)
zip(*(p * 10))
[(1, 1, 1, 1, 1, 1, 1, 1, 1, 1), (2, 2, 2, 2, 2, 2, 2, 2, 2, 2)]
zip(*(p * 10))
Traceback (most recent call last):
File , line 0, in input##10
TypeError: zip() takes at most 0 arguments (10 given)
Upon
Hi,
I've got a gripe with IronPython's file implementation. The following code
produces two different results in CPython and IronPython:
print ''.join('%02x' % ord(c) for c in file('some_binary_file').read(32))
CPython:
01044c1045a1470ec20112012000ec0f03006f1efcc5
Dino Viehland wrote:
The first bug will be fixed in beta 4 - we've done a bunch of cleanup around
the file class to make it all around more compatible with CPython. That not
only includes fixing binary mode but also fixing universal new line mode to
be much more compatible. FYI beta 4
Hi,
I have a CPython script to parse specific data files and allow me to
manipulate them, mostly relying on the struct module. IronPython doesn't
seem to have an implementation of this (yet?) so I used PyPy's
implementation and discovered that IronPython's sys module doesn't
define a
Edward K. Ream wrote:
Shouldn't the -i option actually be stopping IronPython from exiting
Right. That's why opening IronPython from a console is a workaround, not a
fix.
Technically, a workaround should provide a temporary fix. Simply
stopping the console window from disappearing
Hi,
(I did a couple of searches on the archives and checked the bug tracker
but still found nothing directly relating to this. Hopefully I didn't
miss anything.)
I'm having a problem trying to attach an event handler to
System.Windows.Forms.Application.Idle:
Martin Maly wrote:
the Random.Next is not a static method. You can either pass the instance as the
first argument:
Hi Martin,
Yes, I figured that out a little while later. Too bad I had already made
a fool of myself. ;-)
However, I think your question brings up a valid point ... how do
Keith J. Farmer wrote:
I didn't see a second set of square brackets. Also, what if what you
have is an indexer, in which case the parameter is supplied also with
square brackets?
Then you have a lot of square brackets? ;-)
Of course it's not very pretty. Do you have a suggestion that
Keith J. Farmer wrote:
Illustrating my concern with indexers:
delegate Foo DelegateType();
public static DelegateType this (Type type) { }
public FooT() { }
x = Foo[typeof(int)]() .. is ambiguous. You can't determine if you've
called the constructor, or if you've called the static indexer,
Keith J. Farmer wrote:
You can -- at least in asp.net 2
Yes, it appears you can...however IronPython throws away exported types
without a namespace. Not sure what the reason for this may be, I'd have
thought that classes from an assembly without a namespace should just
belong to the
Hi,
I am curious as to how function-overloads plan on being handled in
future versions of IronPython.
--
Jonathan
___
users-ironpython.com mailing list
users-ironpython.com@lists.ironpython.com
Martin Maly wrote:
The overloaded function resolution (when IronPython calls .Net) is
currently being worked on. You probably read the original code in which
IronPython chooses the first callable alternative. The new code does
better finds out all methods that can be called and tries to choose
Hi,
Recently, I've run across a bit of a bug while importing things with the
from X import Y syntax, when Y is anything but an an attribute of X
that already exists.
Demonstration:
IronPython 0.7.6 on .NET 2.0.50215.44
Copyright (c) Microsoft Corporation. All rights reserved.
from foo import
38 matches
Mail list logo