News for hackers. Stuff that matters.
Re:Python Best Practice Patterns by pyre on Saturday March 01, 2014 @09:45AM (#7324351)
> Cascading methods: that's a big no. The idiom is that if a method may change the state of the object then it should return None (eg `set.add`)

So methods that mutate state, and don't return None are un-Pythonic?

What about this example:

  a = [1, 2, 3]
  b = a.pop()
pop() mutates the state of a and returns a value that is not None. Is the Python code language itself un-Pythonic?

There are no comments on this comment yet.