What is a function parameter =[] for?

Chris Angelico rosuav at gmail.com
Fri Nov 20 11:37:03 EST 2015


On Sat, Nov 21, 2015 at 3:31 AM, Marko Rauhamaa <marko at pacujo.net> wrote:
> Consider the mutator pattern:
>
>     def name(self, value=omitted):
>         if value is omitted:
>             return self._name
>         self._name = value
>
>     <URL: https://en.wikipedia.org/wiki/Mutator_method#C.2B.2B_example>

That should DEFINITELY be two functions.

Or just an attribute.

ChrisA



More information about the Python-list mailing list