diff -r 45eab45be175 Lib/collections/__init__.py --- a/Lib/collections/__init__.py Mon Nov 21 04:22:43 2016 +0000 +++ b/Lib/collections/__init__.py Mon Nov 21 09:06:49 2016 +0000 @@ -304,7 +304,7 @@ except ImportError: _class_template = """\ from builtins import property as _property, tuple as _tuple from operator import itemgetter as _itemgetter -from collections import OrderedDict +from collections import OrderedDict as _OrderedDict class {typename}(tuple): '{typename}({arg_list})' @@ -338,7 +338,7 @@ class {typename}(tuple): def _asdict(self): 'Return a new OrderedDict which maps field names to their values.' - return OrderedDict(zip(self._fields, self)) + return _OrderedDict(zip(self._fields, self)) def __getnewargs__(self): 'Return self as a plain tuple. Used by copy and pickle.' diff -r 45eab45be175 Lib/functools.py --- a/Lib/functools.py Mon Nov 21 04:22:43 2016 +0000 +++ b/Lib/functools.py Mon Nov 21 09:06:49 2016 +0000 @@ -400,7 +400,70 @@ class partialmethod(object): ### LRU Cache function decorator ################################################################################ -_CacheInfo = namedtuple("CacheInfo", ["hits", "misses", "maxsize", "currsize"]) +#/*[python input] +#from collections import namedtuple +#CacheInfo = namedtuple("CacheInfo", ["hits", "misses", "maxsize", "currsize"]) +#print(CacheInfo._source) +# +# +# +#[python start generated code]*/ +from builtins import property as _property, tuple as _tuple +from operator import itemgetter as _itemgetter +from collections import OrderedDict as _OrderedDict + +class CacheInfo(tuple): + 'CacheInfo(hits, misses, maxsize, currsize)' + + __slots__ = () + + _fields = ('hits', 'misses', 'maxsize', 'currsize') + + def __new__(_cls, hits, misses, maxsize, currsize): + 'Create new instance of CacheInfo(hits, misses, maxsize, currsize)' + return _tuple.__new__(_cls, (hits, misses, maxsize, currsize)) + + @classmethod + def _make(cls, iterable, new=tuple.__new__, len=len): + 'Make a new CacheInfo object from a sequence or iterable' + result = new(cls, iterable) + if len(result) != 4: + raise TypeError('Expected 4 arguments, got %d' % len(result)) + return result + + def _replace(_self, **kwds): + 'Return a new CacheInfo object replacing specified fields with new values' + result = _self._make(map(kwds.pop, ('hits', 'misses', 'maxsize', 'currsize'), _self)) + if kwds: + raise ValueError('Got unexpected field names: %r' % list(kwds)) + return result + + def __repr__(self): + 'Return a nicely formatted representation string' + return self.__class__.__name__ + '(hits=%r, misses=%r, maxsize=%r, currsize=%r)' % self + + def _asdict(self): + 'Return a new OrderedDict which maps field names to their values.' + return _OrderedDict(zip(self._fields, self)) + + def __getnewargs__(self): + 'Return self as a plain tuple. Used by copy and pickle.' + return tuple(self) + + hits = _property(_itemgetter(0), doc='Alias for field number 0') + + misses = _property(_itemgetter(1), doc='Alias for field number 1') + + maxsize = _property(_itemgetter(2), doc='Alias for field number 2') + + currsize = _property(_itemgetter(3), doc='Alias for field number 3') + + +#/*[python end generated code: output=0ed8ce9e3e1b7598 input=ee2c7664bc4d78e7]*/ + +_CacheInfo = CacheInfo +del CacheInfo + class _HashedSeq(list): """ This class guarantees that hash() will be called no more than once diff -r 45eab45be175 Makefile.pre.in --- a/Makefile.pre.in Mon Nov 21 04:22:43 2016 +0000 +++ b/Makefile.pre.in Mon Nov 21 09:06:49 2016 +0000 @@ -560,8 +560,9 @@ coverage-report: # Run "Argument Clinic" over all source files # (depends on python having already been built) .PHONY=clinic -clinic: $(BUILDPYTHON) $(srcdir)/Modules/_blake2/blake2s_impl.c +clinic: $(BUILDPYTHON) $(srcdir)/Modules/_blake2/blake2s_impl.c $(srcdir)/Lib/functools.py $(RUNSHARED) $(PYTHON_FOR_BUILD) ./Tools/clinic/clinic.py --make + $(RUNSHARED) $(PYTHON_FOR_BUILD) ./Tools/clinic/clinic.py Lib/functools.py # Build the interpreter $(BUILDPYTHON): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) diff -r 45eab45be175 Tools/clinic/clinic.py --- a/Tools/clinic/clinic.py Mon Nov 21 04:22:43 2016 +0000 +++ b/Tools/clinic/clinic.py Mon Nov 21 09:06:49 2016 +0000 @@ -381,7 +381,6 @@ class Language(metaclass=abc.ABCMeta): def __init__(self, filename): pass - @abc.abstractmethod def render(self, clinic, signatures): pass