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 <rep...@bugs.python.org>
<http://bugs.python.org/issue22676>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to