>>> from django.forms import BaseFormSet
>>> from django.forms import formset_factory
>>> class BaseArticleFormSet(BaseFormSet):
... def get_form_kwargs(self, index):
... kwargs = super(BaseArticleFormSet, self).get_form_kwargs(index)
... kwargs['custom_kwarg'] = index
... return kwargs
====Quotation=====
I can see that
1) Example doesn't illustrate the text of documentation. It illustrates redefinition of the method.
2) The example seems to be bad itself. Doesn't this brings about some side effect?
https://en.wikipedia.org/wiki/Side_effect_(computer_science)
Wouldn't just kwargs = formset.get_form_kwargs(0) be better?
If this makes sense, I could create a ticket at Djangoproject.
But I'm too green for deep understanding this example. So, I decided to discuss it here.