This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年03月30日 10:18 by Fade78, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (2) | |||
|---|---|---|---|
| msg157133 - (view) | Author: (Fade78) | Date: 2012年03月30日 10:18 | |
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. |
|||
| msg157137 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2012年03月30日 14:21 | |
The current behavior is how we want the functions to work. If you want to debate the design, the best forum would probably be python-ideas. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:28 | admin | set | github: 58656 |
| 2012年03月30日 14:21:58 | r.david.murray | set | status: open -> closed nosy: + r.david.murray messages: + msg157137 resolution: rejected stage: resolved |
| 2012年03月30日 10:18:26 | Fade78 | create | |