class OurClass(object): """Class docstring.""" def __init__(self, arg1, arg2): """Method docstring.""" self.arg1 = arg1 self.arg2 = arg2 def printargs(self): """Method docstring.""" print self.arg1 print self.arg2
For those who like their statistics simplistic:package OurClass; use Moose; has ‘arg1’ => ( is => ‘rw’ ); has ‘arg2’ => ( is => ‘rw’ ); sub printargs { my $self = shift; say $self->arg1; say $self->arg2; } no Moose;
Rather than seeking approval from any self-appointed echo chamber, I'm wondering if there are any here with the Python chops to tell me that I've created a straw man (like missing out the call to __PACKAGE__->meta->make_immutable;) or that there's a Python feature specific to OO that they really wish was in Moose or implemented more naturally.
I'm not trying to get anyone's back up, just meditating on how to make the comparison fair.
best,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Python OO v Moose
by tobyink (Canon) on Feb 06, 2013 at 13:19 UTC | |
by Ea (Chaplain) on Feb 07, 2013 at 16:01 UTC | |
by tobyink (Canon) on Feb 07, 2013 at 16:43 UTC | |
|
Re: Python OO v Moose
by choroba (Cardinal) on Feb 06, 2013 at 11:34 UTC | |
by Ea (Chaplain) on Feb 06, 2013 at 12:33 UTC | |
by tobyink (Canon) on Feb 06, 2013 at 13:09 UTC | |
|
Re: Python OO v Moose v Badger
by Anonymous Monk on Feb 06, 2013 at 13:05 UTC | |
|
Re: Python OO v Moose
by locked_user sundialsvc4 (Abbot) on Feb 12, 2013 at 19:42 UTC |