[issue22676] Creating the string representation of a module is slower

Brett Cannon report at bugs.python.org
Mon Oct 20 17:02:26 CEST 2014


Brett Cannon added the comment:

In Python 3.3 the import machinery changed to use importlib. This means the code to create the representation of a module now calls into Python code (the `<frozen importlib._bootstrap>:690(_module_repr)` you're seeing).

But my question is why are you not calling PyObject_HasAttr() before calling PyObject_GetAttr()? Exceptions may be relatively cheap but they are not free.

----------
nosy: +brett.cannon
status: open -> pending
title: _pickle.c -> Creating the string representation of a module is slower

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22676>
_______________________________________


More information about the Python-bugs-list mailing list