MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / __init_subclass__

Method __init_subclass__

lib/matplotlib/patches.py:2399–2416  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

2397 """
2398
2399 def __init_subclass__(cls):
2400 # Automatically perform docstring interpolation on the subclasses:
2401 # This allows listing the supported styles via
2402 # - %(BoxStyle:table)s
2403 # - %(ConnectionStyle:table)s
2404 # - %(ArrowStyle:table)s
2405 # and additionally adding .. ACCEPTS: blocks via
2406 # - %(BoxStyle:table_and_accepts)s
2407 # - %(ConnectionStyle:table_and_accepts)s
2408 # - %(ArrowStyle:table_and_accepts)s
2409 _docstring.interpd.register(**{
2410 f"{cls.__name__}:table": cls.pprint_styles(),
2411 f"{cls.__name__}:table_and_accepts": (
2412 cls.pprint_styles()
2413 + "\n\n .. ACCEPTS: ["
2414 + "|".join(map(" '{}' ".format, cls._style_list))
2415 + "]")
2416 })
2417
2418 def __new__(cls, stylename, **kwargs):
2419 """Return the instance of the subclass with the given style name."""

Callers

nothing calls this directly

Calls 3

pprint_stylesMethod · 0.80
joinMethod · 0.80
registerMethod · 0.45

Tested by

no test coverage detected