naveen wrote:
Is it possible to split up a class definition over multiple files?
Not exactly, but you can do variations of this:
... [subclass a class]
Multiple inheritance can also be useful:
# A_Part1.py
class A_Part1:
...
# A_Part2.py
class A_Part2:
...
# A.py
from A_Part1
On Mon, 17 Aug 2009 21:45:57 -0700, naveen wrote:
Is it possible to split up a class definition over multiple files?
Not exactly, but you can do variations of this:
In file A.py, create:
class Parent:
def method(self):
return Method
In file B.py, do this:
import A
class
Is it possible to split up a class definition over multiple files?
Not exactly, but you can do variations of this:
... [subclass a class]
Steven
Thanks Steven.
I guess I will just preprocess the script:
class.sh
cat partA.py class.py
cat partB class.py
python class.py
/class.sh
--
naveen naveen.g...@gmail.com writes:
I guess I will just preprocess the script:
class.sh
cat partA.py class.py
cat partB class.py
python class.py
/class.sh
This, to me, is a programming smell; not necessarily bad, but an
indicator of bad practice. What is the problem you're trying to
indicator of bad practice. What is the problem you're trying to solve?
Ben Finney
No major problem.
I was just trying to make some experimental changes to autokey. My
repo: http://github.com/tinku99/autokey.git/
Didn't want to subclass or reorganize a class just yet.
--
On Tue, Aug 18, 2009 at 1:57 AM, Steven
D'Apranoste...@remove.this.cybersource.com.au wrote:
On Mon, 17 Aug 2009 21:45:57 -0700, naveen wrote:
Is it possible to split up a class definition over multiple files?
Not exactly, but you can do variations of this:
In file A.py, create:
class
18-08-2009 o 06:58:58 Xavier Ho cont...@xavierho.com wrote:
On Tue, Aug 18, 2009 at 2:45 PM, naveen naveen.g...@gmail.com wrote:
Is it possible to split up a class definition over multiple files?
-
Answer in short, I don't think so.
Why not?
-
File a.py:
class MyClass:
def
Is it possible to split up a class definition over multiple files?
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Aug 18, 2009 at 2:45 PM, naveen naveen.g...@gmail.com wrote:
Is it possible to split up a class definition over multiple files?
-
Answer in short, I don't think so.
Now why would you want to do that?
There is another solution - have a main class for shared methods, and have
other