[Ironpython-users] IronPython, Daily Digest 11/13/2013

CodePlex no_reply at codeplex.com
Thu Nov 14 09:28:44 CET 2013


Hi ironpython,

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

In today's digest:ISSUES

1. [New issue] unbound methods instead of bound methods in cloned class instances

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

ISSUES

1. [New issue] unbound methods instead of bound methods in cloned class instances
http://ironpython.codeplex.com/workitem/34649
User s3e3 has proposed the issue:

"Please consider following code example from IronPython 2.7.4 console:
import copy

def clone(cls):
    """Create clone of provided class"""
    attrs = vars(cls).copy()
    skipped = ['__dict__', '__weakref__']
    for attr in skipped:
        try:
            del attrs[attr]
        except KeyError:
            pass
    cattrs = copy.deepcopy(attrs)
    return type(cls.__name__, cls.__bases__, cattrs)

class C(object):
    def __init__(self, x):
        self.x = x

CC = clone(C)

CC(1)

Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: unbound method __init__() must be called with C instance as first argument (got int instance instead)

In previous version of IronPython 2.7.3 as well as in CPython 2.7.5:
CC(1)
instantiates and initializes object normally, i.e. without raising exception."
----------------------------------------------



----------------------------------------------
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/20131114/98ddff43/attachment.html>


More information about the Ironpython-users mailing list