On Wed, Aug 6, 2014 at 10:49 AM, Steven D'Aprano
<steve+comp.lang.pyt...@pearwood.info> wrote:
> A
> plethora of argument-less methods is a code smell -- that doesn't mean it's
> *necessarily* a bad idea, but the class design really needs a careful
> review.

There are plenty of no-argument mutator methods, where the name of the
method (and the target object, obviously) is all the info you need.
You can clear() or copy() something with any more info, reverse() a
list, pop() from a list, etc. (Okay, the last one has a default
argument, but that raises an even worse point: adding a defaulted
argument to a no-argument method suddenly stops it from being a
property, which violates the usual rule that you can add a defaulted
argument to anything without breaking anything.)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to