This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jaraco
Recipients jaraco, theller
Date 2009-09-17.20:09:02
SpamBayes Score 0.00023508685
Marked as misclassified No
Message-id <1253218147.13.0.782038011817.issue5042@psf.upfronthosting.co.za>
In-reply-to
Content
That was easier than I thought. The generated code is _ugly_ but it did
seem to be able to generate it.

I created init.pyx

{{{
class X(object):
	def __init__(self, *args, **kw):
		"""This is how the Structure's __init__method SHOULD be"""
		if args:
			names = []
			for tp in self.__class__.mro()[2::-1]:
				for n, _ in tp._fields_:
					names.append(n)
			for n, v in zip(names, args):
				setattr(self, n, v)
		for n, v in kw.iteritems():
			setattr(self, n, v)
}}}

Then, ran cython init.pyx and got the attached file.

Is that any help?
History
Date User Action Args
2009-09-17 20:09:07jaracosetrecipients: + jaraco, theller
2009-09-17 20:09:07jaracosetmessageid: <1253218147.13.0.782038011817.issue5042@psf.upfronthosting.co.za>
2009-09-17 20:09:06jaracolinkissue5042 messages
2009-09-17 20:09:06jaracocreate