Extending classes __init__behavior for newbies
Westley MartÃnez
anikom15 at gmail.com
Mon Feb 14 18:29:04 EST 2011
More information about the Python-list mailing list
Mon Feb 14 18:29:04 EST 2011
- Previous message (by thread): Extending classes __init__behavior for newbies
- Next message (by thread): Extending classes __init__behavior for newbies
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Mon, 2011-02-14 at 11:15 -0800, rantingrick wrote: > On Feb 14, 11:55 am, Michael Sparks <spark... at gmail.com> wrote: > > It can be broken if someone tries to use the class as is - that is > > treating the class as a model - to drive a display of the ship. If > > it was written using super() then that wouldn't be a problem. > > > > For example, I could write a display mixin that I'd like to use like > > this: > > [snip: miles of code not formatted for 79 chars!] > > That was a nice long winded example of how to break code by using it > in an improper manner. You could have just called the base with one > too many arguments and achieved the same. However the developer would > be suffering from either; severe memory loss and/or lack of reading > comprehension if he tried to use -a- his class interface in a manner > that it was not originally intended. I could likewise use a hammer to > drive screws and then rant and rave later how the hammer is > insufficient. Surely my methods could not be a fault, surely? ;-) That's nowhere near a mile.
- Previous message (by thread): Extending classes __init__behavior for newbies
- Next message (by thread): Extending classes __init__behavior for newbies
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list