[Python-ideas] Fast sum() for non-numbers

Joshua Landau joshua at landau.ws
Fri Jul 12 04:28:11 CEST 2013


On 12 July 2013 03:07, Joshua Landau <joshua at landau.ws> wrote:
> Shall I list some stdlib types; you can tell me what it's fast for:
>
> # do this later

I knew one-day I was going to forget to go back and finish a post.

OK, here is a list of all types in the stdlib with __add__ or __iadd__:

bool
bytearray
bytes
codecs.CodecInfo
collections.Counter
collections.UserList
collections.UserString
collections.abc.MutableSequence
collections.abc.MutableSequence
collections.deque
collections.deque
complex
float
functools.CacheInfo
functools._HashedSeq
inspect.ArgInfo
inspect.ArgSpec
inspect.Arguments
inspect.Attribute
inspect.ClosureVars
inspect.FullArgSpec
inspect.ModuleInfo
inspect.Traceback
inspect._ParameterKind
int
list
os.terminal_size
os.terminal_size
posix.sched_param
posix.sched_param
posix.stat_result
posix.stat_result
posix.statvfs_result
posix.statvfs_result
posix.times_result
posix.times_result
posix.uname_result
posix.uname_result
posix.waitid_result
posix.waitid_result
signal.struct_siginfo
str
str
tokenize.TokenInfo
tuple
weakcallableproxy
weakcallableproxy
weakproxy
weakproxy

You tell me whether you have 100% coverage of the stdlib things that "sum"
is plausible for.


More information about the Python-ideas mailing list