Home
last modified time | relevance | path

Searched refs:__new__ (Results 1 – 25 of 177) sorted by relevance

12345678

/third_party/python/Lib/
Denum.py180 def __new__(metacls, cls, bases, classdict, **kwds): member in EnumMeta
192 __new__, save_new, use_args = metacls._find_new_(
215 enum_class = super().__new__(metacls, cls, bases, classdict, **kwds)
285 enum_member = __new__(enum_class)
289 enum_member = __new__(enum_class, *args)
341 enum_class.__new_member__ = __new__
342 enum_class.__new__ = Enum.__new__
385 return cls.__new__(cls, value)
518 enum_class = metacls.__new__(metacls, class_name, bases, classdict)
638 __new__ = classdict.get('__new__', None)
[all …]
Dcopyreg.py49 obj = object.__new__(cls)
51 obj = base.__new__(cls, state)
57 _new_type = type(int.__new__)
67 new = base.__new__
101 return cls.__new__(cls, *args)
107 return cls.__new__(cls, *args, **kwargs)
Dabc.py105 def __new__(mcls, name, bases, namespace, **kwargs): member in ABCMeta
106 cls = super().__new__(mcls, name, bases, namespace, **kwargs)
D_threading_local.py207 def __new__(cls, /, *args, **kw): member in local
210 self = object.__new__(cls)
D_py_abc.py35 def __new__(mcls, name, bases, namespace, /, **kwargs): member in ABCMeta
36 cls = super().__new__(mcls, name, bases, namespace, **kwargs)
Ddatetime.py461 def __new__(cls, days=0, seconds=0, microseconds=0, member in timedelta
555 self = object.__new__(cls)
792 def __new__(cls, year, month=None, day=None): member in date
812 self = object.__new__(cls)
817 self = object.__new__(cls)
1185 def __new__(cls, year, week, weekday, /): member in IsoCalendarDate
1186 return super().__new__(cls, (year, week, weekday))
1239 def __new__(cls, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0): member in time
1261 self = object.__new__(cls)
1268 self = object.__new__(cls)
[all …]
Dsre_constants.py57 def __new__(cls, value, name): member in _NamedIntConstant
58 self = super(_NamedIntConstant, cls).__new__(cls, value)
/third_party/python/Lib/test/
Dtest_super.py151 def __new__(cls, name, bases, namespace): member in TestSuper.test___class___new.Meta
153 self = super().__new__(cls, name, bases, namespace)
169 def __new__(cls, name, bases, namespace): member in TestSuper.test___class___delayed.Meta
204 def __new__(cls, name, bases, namespace): member in TestSuper.test___classcell___expected_behaviour.Meta
207 return super().__new__(cls, name, bases, namespace)
237 def __new__(cls, name, bases, namespace): member in TestSuper.test___classcell___missing.Meta
239 return super().__new__(cls, name, bases, namespace)
259 def __new__(cls, name, bases, namespace, cell): member in TestSuper.test___classcell___overwrite.Meta
261 return super().__new__(cls, name, bases, namespace)
273 def __new__(cls, name, bases, namespace): member in TestSuper.test___classcell___wrong_cell.Meta
[all …]
Dtest_subclassinit.py117 def __new__(cls, name, bases, ns): member in Test.test_set_name_metaclass.Meta
118 ret = super().__new__(cls, name, bases, ns)
181 def __new__(cls, name, bases, ns): member in Test.test_set_name_init_subclass.Meta
182 self = super().__new__(cls, name, bases, ns)
239 def __new__(cls, name, bases, namespace, otherarg): member in Test.test_errors.MyMeta
240 return super().__new__(cls, name, bases, namespace)
254 def __new__(cls, name, bases, namespace): member in Test.test_errors_changed_pep487.MyMeta
255 return super().__new__(cls, name=name, bases=bases,
263 def __new__(cls, name, bases, namespace, otherarg): member in Test.test_errors_changed_pep487.MyMeta
264 self = super().__new__(cls, name, bases, namespace)
Dtest_descr.py270 def __new__(cls, *args, **kwds): member in OperatorsTest.test_complexes.Number
271 result = complex.__new__(cls, *args)
495 def __new__(cls, name, bases, dict): member in ClassPropertiesAndMethods.test_metaclass.M1
497 return type.__new__(cls, name, bases, dict)
508 def __new__(cls, name, bases, dict): member in ClassPropertiesAndMethods.test_metaclass.M2
509 self = object.__new__(cls)
536 def __new__(metaclass, name, bases, dict): member in ClassPropertiesAndMethods.test_metaclass.autosuper
537 cls = super(autosuper, metaclass).__new__(metaclass,
569 def __new__(metaclass, name, bases, dict): member in ClassPropertiesAndMethods.test_metaclass.autoproperty
584 return super(autoproperty, metaclass).__new__(metaclass,
[all …]
Dtest_enum.py221 def __new__(cls, value, description=""): member in TestEnum.test_dir_on_sub_with_behavior_including_instance_dict_on_super.SuperEnum
222 obj = int.__new__(cls, value)
648 def __new__(cls, value): member in TestEnum.test_inherited_data_type.BrokenInt
649 return int.__new__(cls, value)
1205 def __new__(metacls, cls, bases, classdict): member in TestEnum.test_multiple_mixin_mro.auto_enum
1221 return super(auto_enum, metacls).__new__(
1243 def __new__(cls, *args): member in TestEnum.test_subclasses_with_getnewargs.NamedInt
1248 self = int.__new__(cls, *args)
1286 self.assertIs(NEI.__new__, Enum.__new__)
1300 def __new__(cls, *args): member in TestEnum.test_subclasses_with_getnewargs_ex.NamedInt
[all …]
Dtest_class.py627 C.__new__(C, 42)
633 object.__new__(C, 42)
640 def __new__(cls, *args, **kwargs): member in ClassTests.testConstructorErrorMessages.D
641 super().__new__(cls, *args, **kwargs)
651 D.__new__(D, 42)
654 object.__new__(D, 42)
Dann_module.py44 def __new__(meta, name, bases, namespace): member in Meta
45 return super().__new__(meta, name, bases, namespace)
Dtest_copy.py44 def __new__(cls, foo): member in TestCopy.test_copy_registry.C
45 obj = object.__new__(cls)
194 def __new__(cls, foo): member in TestCopy.test_copy_inst_getnewargs.C
195 self = int.__new__(cls)
211 def __new__(cls, *, foo): member in TestCopy.test_copy_inst_getnewargs_ex.C
212 self = int.__new__(cls)
306 def __new__(cls, foo): member in TestCopy.test_deepcopy_registry.C
307 obj = object.__new__(cls)
490 def __new__(cls, foo): member in TestCopy.test_deepcopy_inst_getnewargs.C
491 self = int.__new__(cls)
[all …]
/third_party/protobuf/python/google/protobuf/
Ddescriptor.py80 def __new__(cls): member in _Lock
81 self = object.__new__(cls)
289 def __new__(cls, name, full_name, filename, containing_type, fields, member in Descriptor
536 def __new__(cls, name, full_name, index, number, type, cpp_type, label, member in FieldDescriptor
654 def __new__(cls, name, full_name, filename, values, member in EnumDescriptor
714 def __new__(cls, name, index, number, member in EnumValueDescriptor
757 def __new__( member in OneofDescriptor
801 def __new__(cls, name, full_name, index, methods, options=None, member in ServiceDescriptor
866 def __new__(cls, name, full_name, index, containing_service, member in MethodDescriptor
927 def __new__(cls, name, package, options=None, member in FileDescriptor
[all …]
/third_party/python/Lib/ctypes/test/
Dtest_init.py9 def __new__(cls): member in X
10 result = super().__new__(cls)
/third_party/python/Lib/http/
D__init__.py25 def __new__(cls, value, phrase, description=''): member in HTTPStatus
26 obj = int.__new__(cls, value)
/third_party/python/Lib/importlib/metadata/
D_adapters.py30 def __new__(cls, orig: email.message.Message): member in Message
31 res = super().__new__(cls)
/third_party/python/Lib/test/test_asyncio/
Dtest_futures.py173 fut = self.cls.__new__(self.cls, loop=self.loop)
176 fut = self.cls.__new__(self.cls, loop=self.loop)
179 fut = self.cls.__new__(self.cls, loop=self.loop)
183 fut = self.cls.__new__(self.cls, loop=self.loop)
187 fut = self.cls.__new__(self.cls, loop=self.loop)
191 fut = self.cls.__new__(self.cls, loop=self.loop)
195 fut = self.cls.__new__(self.cls, loop=self.loop)
199 fut = self.cls.__new__(self.cls, loop=self.loop)
205 fut = self.cls.__new__(self.cls, loop=self.loop)
211 fut = self.cls.__new__(self.cls, loop=self.loop)
[all …]
/third_party/node/tools/inspector_protocol/jinja2/
D_compat.py91 def __new__(cls, name, this_bases, d): member in with_metaclass.metaclass
93 return type.__new__(metaclass, 'temporary_class', (), {})
/third_party/node/tools/inspector_protocol/markupsafe/
D__init__.py68 def __new__(cls, base=u'', encoding=None, errors='strict'): member in Markup
72 return text_type.__new__(cls, base)
73 return text_type.__new__(cls, base, encoding, errors)
/third_party/skia/third_party/externals/markupsafe/
D__init__.py68 def __new__(cls, base=u'', encoding=None, errors='strict'): member in Markup
72 return text_type.__new__(cls, base)
73 return text_type.__new__(cls, base, encoding, errors)
/third_party/python/Doc/library/
Denum.rst396 Note: if your enumeration defines :meth:`__new__` and/or :meth:`__init__` then
758 When to use :meth:`__new__` vs. :meth:`__init__`
761 :meth:`__new__` must be used whenever you want to customize the actual value of
763 :meth:`__new__` or :meth:`__init__`, with :meth:`__init__` being preferred.
772 ... def __new__(cls, value, label, unit):
773 ... obj = bytes.__new__(cls, [value])
808 - use a tuple as the value and a custom :meth:`__new__` to replace the
868 Using a custom :meth:`__new__`
871 Using an auto-numbering :meth:`__new__` would look like::
874 ... def __new__(cls):
[all …]
/third_party/jinja2/
D_compat.py98 def __new__(cls, name, this_bases, d): member in with_metaclass.metaclass
101 return type.__new__(metaclass, "temporary_class", (), {})
/third_party/skia/third_party/externals/jinja2/
D_compat.py98 def __new__(cls, name, this_bases, d): member in with_metaclass.metaclass
101 return type.__new__(metaclass, "temporary_class", (), {})

12345678