Re: Classes - "delegation" question.

2014-12-25 Thread Ben Finney
Steven D'Aprano writes: > However, be warned that there are two subtly different models for > delegation. Here's the one that people seem to forget: > > http://code.activestate.com/recipes/519639-true-lieberman-style-delegation-in-python/ Very interesting! The recipe at that URL works only on P

Re: Classes - "delegation" question.

2014-12-18 Thread Steven D'Aprano
dieter wrote: > "Ivan Evstegneev" writes: >> I have a question about "delegation" coding pattern(I'm working with >> Python 3.4). > > Unlike Java, Python supports "multiple inheritance". This means > that you need "delegation" much more rarely in Python. > Python does not have much special suppo

Re: Classes - "delegation" question.

2014-12-17 Thread dieter
"Ivan Evstegneev" writes: > I have a question about "delegation" coding pattern(I'm working with Python > 3.4). Unlike Java, Python supports "multiple inheritance". This means that you need "delegation" much more rarely in Python. Python does not have much special support for delegation: usually,

Classes - "delegation" question.

2014-12-17 Thread Ivan Evstegneev
Hello guys, I have a question about "delegation" coding pattern(I'm working with Python 3.4). In order to describe my question , I'll provide particular example: Let assume I have two classes written in module named person.py: Case 1: class Person: def __init__(self, name, job = None,