Message157133
The built-in functions working with iterable should also work with single object that is relevent.
For example:
max([1,6,5]) -> 6
max(6) -> TypeError because not an iterable (actual behavior)
max(6) -> 6 (wanted pythonic behavior)
So if I write a generic function like this:
def f(x):
totalsum+=sum(x)
it fails if x is not an iterable. But I want the argument to be anything possible. Using if(type) to separate use cases is not very pythonic. |
|
Date |
User |
Action |
Args |
2012-03-30 10:18:26 | Fade78 | set | recipients:
+ Fade78 |
2012-03-30 10:18:26 | Fade78 | set | messageid: <1333102706.9.0.091568052428.issue14451@psf.upfronthosting.co.za> |
2012-03-30 10:18:26 | Fade78 | link | issue14451 messages |
2012-03-30 10:18:26 | Fade78 | create | |
|