I have some classes that have shared behaviours, for example in our
scenario an object can be visited, where something that is visitable
would have some behaviour like
--8---cut here---start-8---
class Visitable(Mixin):
FIELDS = {
'visits': [],
On Wed, 03 Apr 2013 15:04:51 +0100, andrea crotti wrote:
I have some classes that have shared behaviours, for example in our
scenario an object can be visited, where something that is visitable
would have some behaviour like
[snip mixins]
By the way, it's a common convention to name mixin
2013/4/3 Steven D'Aprano steve+comp.lang.pyt...@pearwood.info
[snip]
So, if you think of Visitable as a gadget that can be strapped onto
your MyObj as a component, then composition is probably a better design.
But if you think of Visitable as a mere collection of behaviour and
state, then a
On 2013-04-03, andrea crotti andrea.crott...@gmail.com wrote:
Well I can explain better the situation to make it more clear.
We are using CouchDb and so far it has been (sigh) a brutal
manipulation of dictionaries everywhere, with code duplication
and so on.
Now I wanted to encapsulate all