<div>The Python language doesn't support partial classes, but you can probably achieve something similar by using multiple inheritance. That is, put each function into a separate class and then create an aggregate class that derives from each of them.</div>
<div> </div>
<div><font face="courier new,monospace">>>> class A(object):<br>... def test1(self):<br>... print 'test1'<br>...<br>>>> class B(object):<br>... def test2(self):<br>... print 'test2'<br>
...<br>>>> class C(A, B):<br>... def __init__(self):<br>... self.test1()<br>... self.test2()<br>...<br>>>> C()<br>test1<br>test2<br><C object at 0x000000000000002B><br>>>><br>
</font></div>
<div>There are generally certain "gotchas" to look out for with multiple inheritance, but provided that you're not using the same method names across multiple base classes -- including special names like __init__ -- you shouldn't run into any of them.</div>
<div><br> </div>
<div class="gmail_quote">On Thu, Jun 12, 2008 at 7:29 PM, Michael Stephens <<a href="mailto:falcon@uwyo.edu">falcon@uwyo.edu</a>> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Our company has a scripting/macro system. Functions are stored in a database and at runtime we generate python classes. For a form we have multiple functions declared. We want to use IronPython studio to emit the python classes to a file to be debugged. Is it possible to build a partial class so that we can have one file per function.<br>
<br>file function324.py<br>partial class Form76:<br> def function324.py<br><br>file function325.py<br>partial class Form76<br> def function324.py<br><br>file base325.py<br> #do not edit anything in this file! changes will not be saved!<br>
<br clear="all"><br>Michael Stephens<br><br>Electrical Engineering Graduate Student<br>University of Wyoming<br><a href="mailto:falcon@uwyo.edu" target="_blank">falcon@uwyo.edu</a> or <a href="mailto:89iroc@gmail.com" target="_blank">89iroc@gmail.com</a> <br>
_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br><a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
<br></blockquote></div><br>