What is "empty" expression in django rest_framework.serializers.BaseSerializer
Question: Here is the `__init__` method in django's
`rest_framework.serializers.BaseSerializer` class.

    
    
    def __init__(self, instance=None, data=empty, **kwargs):
        self.instance = instance
        if data is not empty:
            self.initial_data = data
        self.partial = kwargs.pop('partial', False)
        self._context = kwargs.pop('context', {})
        kwargs.pop('many', None)
        super(BaseSerializer, self).__init__(**kwargs)
    

By default `data=empty`. `empty` is not imported or defined anywhere in
`serializers.py`. And I never saw this before in python (Im still beginner
tho).

How does `empty` work here? From the first look to me it seems that `empty` is
an undefined variable here.


Answer: `empty` is defined in `rest_framework.fields`:
<https://github.com/tomchristie/django-rest-
framework/blob/master/rest_framework/fields.py#L39>.

It can be used in the place that you mention because it's being imported at
line 46: <https://github.com/tomchristie/django-rest-
framework/blob/master/rest_framework/serializers.py#L46>.

