In article ,
Rhodri James wrote:
>
>You'll note that this is, all Aaron's protests to the contrary,
>splitting your class up into multiple cooperating classes.
Ayup.
>If you're set on doing it like this, doing it this way avoids polluting
>your namespace so much:
>
>class ClsB(object):
> c
On Mon, 06 Apr 2009 20:52:50 +0100, jelle wrote:
Hi Aaron,
Thanks a lot for your suggestions.
I wasnt familiar with the __get__ magic, which seems interesting.
So, finally it seems that the cleanest pattern is:
class ClsA( object ):
def __init__( self, other ):
self.inst= other
Hi Aaron,
Thanks a lot for your suggestions.
I wasnt familiar with the __get__ magic, which seems interesting.
So, finally it seems that the cleanest pattern is:
class ClsA( object ):
def __init__( self, other ):
self.inst= other
def submethA( self, arg ):
print( 'submet
On Apr 6, 12:02 pm, Aaron Brady wrote:
> On Apr 6, 5:40 am, jelle wrote:
>
> > Hi,
>
> > I'm working on a pretty large class and I'd like to group several
> > methods under a attribute.
> > Its not convenient to chop up the class in several smaller cla
On Apr 6, 5:40 am, jelle wrote:
> Hi,
>
> I'm working on a pretty large class and I'd like to group several
> methods under a attribute.
> Its not convenient to chop up the class in several smaller classes,
> nor would mixins really solve the issue.
> So, wha
> Whatever it is, you should find a better way instead of cramming
> everything into a single class. That smells of the God Object
> antipattern (http://en.wikipedia.org/wiki/God_object).
Thanks Gerard, I'll take your advice.
-jelle
--
http://mail.python.org/mailman/listinfo/python-list
jelle wrote:
> Hi,
>
> I'm working on a pretty large class
Can you describe what its purpose is?
> and I'd like to group several methods under a attribute.
That doesn't work in Python without bending the Python.
> Its not convenient to chop up the class in
Hi,
I'm working on a pretty large class and I'd like to group several
methods under a attribute.
Its not convenient to chop up the class in several smaller classes,
nor would mixins really solve the issue.
So, what is a pythonic way of grouping several methods under a
attribute?
Many