Feng Yu <rainwood...@gmail.com> added the comment:

Coming here from 
https://github.com/astropy/astropy/issues/9832#issuecomment-570751353

Importing the named module during warning initialization is somewhat like code 
injection. And it may introduce unintended side-effects -- for example if this 
causes some 3rd party libraries to initialize too early?

String matching on the class name of every class in the hierarchy is safer, as 
there is no 'expected' code execution.

----------
nosy: +Feng Yu

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue22543>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to