[Ironpython-users] IronPython, Daily Digest 2/2/2012

no_reply at codeplex.com no_reply at codeplex.com
Fri Feb 3 10:28:29 CET 2012


Hi ironpython,

Here's your Daily Digest of new issues for project "IronPython".

In today's digest:ISSUES

1. [New issue] Deriving from C# class and interfaces
2. [New comment] IP 2.7.1 xml.etree.Elementree#iterparse is not working

----------------------------------------------

ISSUES

1. [New issue] Deriving from C# class and interfaces
http://ironpython.codeplex.com/workitem/32166
User kvncode has proposed the issue:

"With IronPython 2.6.2 I can't seem to derive from a C# base class and implement an interface. It seems in this case the property 'Name' does not get attached to the derived type as 'get_Name', which is how the interface will access the property in C#. 

**** C#
namespace superclasstest2
{
	public interface IAnimal
	{
		string Name{ get; }
	}


	public class Animal
	{
		public virtual string Name
		{
			get { return "animal"; }
		}
	}

	public static class proc
	{
		public static string who(IAnimal animal)
		{
			return animal.Name;
		}
	}
}

**** IronPython
import clr
clr.AddReferenceToFile("superclasstest2.dll")

import superclasstest2 as s

class dog(s.Animal, s.IAnimal):
    def __new__(cls):
        return s.Animal.__new__(cls)
        
    def __init__(self):
        print "i am dog"
        
        
d = dog()
print dir(d)
print "call",s.proc.who(d)


**** Output
i am dog
['Equals', 'GetHashCode', 'GetType', 'MemberwiseClone', 'Name', 'ReferenceEquals', 'ToString', '__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__i
nit__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__']
callTraceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Workspace\KRS\myIronPython\supertest.py", line 16, in <module>
AttributeError: 'dog' object has no attribute 'get_Name'"-----------------

2. [New comment] IP 2.7.1 xml.etree.Elementree#iterparse is not working
http://ironpython.codeplex.com/workitem/31923
User pekkaklarck has commented on the issue:

"It is somewhat weird that this is broken because nowadays IronPython ought to contain a working elementtree implementation [1] that is also available at [2]. What is really weird that this module works fine if I install it separately.

[1] http://ironpython.codeplex.com/workitem/31579
[2] http://effbot.org/zone/element-index.htm"
----------------------------------------------



----------------------------------------------
You are receiving this email because you subscribed to notifications on CodePlex.

To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20120203/061ae57c/attachment.html>


More information about the Ironpython-users mailing list