Skip to content
Snippets Groups Projects
  • Paul Sokolovsky's avatar
    2f5d113f
    py/warning: Support categories for warnings. · 2f5d113f
    Paul Sokolovsky authored
    Python defines warnings as belonging to categories, where category is a
    warning type (descending from exception type). This is useful, as e.g.
    allows to disable warnings selectively and provide user-defined warning
    types.  So, implement this in MicroPython, except that categories are
    represented just with strings.  However, enough hooks are left to implement
    categories differently per-port (e.g. as types), without need to patch each
    and every usage.
    2f5d113f
    History
    py/warning: Support categories for warnings.
    Paul Sokolovsky authored
    Python defines warnings as belonging to categories, where category is a
    warning type (descending from exception type). This is useful, as e.g.
    allows to disable warnings selectively and provide user-defined warning
    types.  So, implement this in MicroPython, except that categories are
    represented just with strings.  However, enough hooks are left to implement
    categories differently per-port (e.g. as types), without need to patch each
    and every usage.