| 1137 | __class_getitem__ = classmethod(GenericAlias) |
| 1138 | |
| 1139 | def _warn_python_reduce_kwargs(py_reduce): |
| 1140 | @wraps(py_reduce) |
| 1141 | def wrapper(*args, **kwargs): |
| 1142 | if 'function' in kwargs or 'sequence' in kwargs: |
| 1143 | import os |
| 1144 | import warnings |
| 1145 | warnings.warn( |
| 1146 | 'Calling functools.reduce with keyword arguments ' |
| 1147 | '"function" or "sequence" ' |
| 1148 | 'is deprecated in Python 3.14 and will be ' |
| 1149 | 'forbidden in Python 3.16.', |
| 1150 | DeprecationWarning, |
| 1151 | skip_file_prefixes=(os.path.dirname(__file__),)) |
| 1152 | return py_reduce(*args, **kwargs) |
| 1153 | return wrapper |
| 1154 | |
| 1155 | reduce = _warn_python_reduce_kwargs(reduce) |
| 1156 | del _warn_python_reduce_kwargs |