Message 285647 - Python tracker

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.

Content
In case it is helpful, here's my list of examples where the AC and existing signature objects are insufficiently expressive:


type(obj)
type(name, bases, mapping)
    two different signatures depending on type   

range(stop)
range(start, stop)
range(start, stop, step)

dict.pop(key[, default])
   default of None has different meaning than missing default
   which raises KeyError when the key is missing

itertools.permutations(iterable[, r])
   where the absence of *r* implies r=len(iterable)

bisect.bisect_right(a, x[, lo[, hi]]) -> index
   where the absence of *hi* implies hi=len(a)

min(iterable, *[, default=obj, key=func]) -> value
min(arg1, arg2, *args, *[, key=func]) -> value
   has two signatures depending on the number of
   positional arguments and a keyword argument
   only used in the first signature.  It's implementation
   is also shared with max().


dict() -> new empty dictionary
dict(mapping) -> new dictionary initialized from a mapping object's
   (key, value) pairs
dict(iterable) -> new dictionary initialized as if via:
   d = {}
   for k, v in iterable:
       d[k] = v
dict(**kwargs) -> new dictionary initialized with the name=value pairs
   in the keyword argument list.  For example:  dict(one=1, two=2)

def sumseq(seq, a=0, b=None):
    # Pure python code with nullable int
    if b is None:
        b = len(seq)
    return sum(seq[a:b])