if name.startswith('__'):
# ... don't have their own docs
if (name, object.__doc__) in _filtered_builtin_functions: continue
+ # are added by typing.Generic on Py3.7+. Like above, can't
+ # use isinstance(object, Generic) because "Class
+ # typing.Generic cannot be used with class or instance
+ # checks" and there's nothing else to catch on, so this
+ # filters out all undocumented cases of these two
+ if sys.version_info >= (3, 7) and name in ['__init_subclass__', '__class_getitem__'] and not object.__doc__:
+ continue
# ... or are auto-generated by attrs
if state.config['ATTRS_COMPATIBILITY']:
if (name, object.__doc__) in _filtered_attrs_functions: continue
<section id="dunder-methods">
<h2><a href="#dunder-methods">Special methods</a></h2>
<dl class="m-doc">
- <dt id="__class_getitem__">
- <span class="m-doc-wrap-bumper">def <a href="#__class_getitem__" class="m-doc-self">__class_getitem__</a>(</span><span class="m-doc-wrap">params)</span>
- </dt>
- <dd></dd>
- <dt id="__init_subclass__">
- <span class="m-doc-wrap-bumper">def <a href="#__init_subclass__" class="m-doc-self">__init_subclass__</a>(</span><span class="m-doc-wrap">*args, **kwargs)</span>
- </dt>
- <dd></dd>
<dt id="__new__">
<span class="m-doc-wrap-bumper">def <a href="#__new__" class="m-doc-self">__new__</a>(</span><span class="m-doc-wrap">cls, *args, **kwds)</span>
</dt>