MCPcopy Index your code
hub / github.com/encode/django-rest-framework / __new__

Method __new__

rest_framework/serializers.py:123–128  ·  view source on GitHub ↗
(cls, *args, **kwargs)

Source from the content-addressed store, hash-verified

121 super().__init__(**kwargs)
122
123 def __new__(cls, *args, **kwargs):
124 # We override this method in order to automatically create
125 # `ListSerializer` classes instead when `many=True` is set.
126 if kwargs.pop('many', False):
127 return cls.many_init(*args, **kwargs)
128 return super().__new__(cls, *args, **kwargs)
129
130 # Allow type checkers to make serializers generic.
131 def __class_getitem__(cls, *args, **kwargs):

Callers 1

__new__Method · 0.45

Calls 1

many_initMethod · 0.45

Tested by

no test coverage detected