classes

Chris Angelico rosuav at gmail.com
Wed Oct 24 11:18:38 EDT 2012


On Thu, Oct 25, 2012 at 2:14 AM, Zero Piraeus <schesis at gmail.com> wrote:
> By the way ... while Bag.addtwice() is legal Python [and I understand
> that you're just playing around here], a method that both "does
> something" [changes the object] and "gives something" [returns a
> useful value] when that's not strictly necessary isn't brilliant
> style.

Side point: It's not that it's *bad* code or even bad style; it just
isn't the way Python generally does things.

ChrisA



More information about the Python-list mailing list