superset: source code reading

import inspect 
# The base class of all charts
import BaseViz
# Global variables globals () All information in the current file, dictionary type; contains classes, variables. . .
# Get the
viz_type attribute of all class objects in the current file
viz_line_list = { o.viz_type: o for o in globals().values() if (inspect.isclass(o) and issubclass(o, BaseViz))}
  • inspect package
  • Subclass determination method

Guess you like

Origin www.cnblogs.com/bennyjane/p/12689024.html