Armin Rigo added the comment:

The pure Python implementation we just wrote in PyPy is:

    for name, arg in zip(names, args):
        if name in kwds:
            raise TypeError("duplicate value for argument %r" % (
                name,))
        self.__setattr__(name, arg)
    for name, arg in kwds.items():
        self.__setattr__(name, arg)

It's the same logic as in _ctypes.c:Struct_init(), where you can add the
C equivalent of "if name in kwds" after getting the name.

----------
keywords: +easy

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1831>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to