A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-November/106169.html below:

[Python-Dev] python3k : imp.find_module raises SyntaxError

[Python-Dev] python3k : imp.find_module raises SyntaxErrorSylvain Thénault sylvain.thenault at logilab.fr
Tue Nov 30 09:34:18 CET 2010
On 29 novembre 14:21, Ron Adam wrote:
> On 11/29/2010 01:22 PM, Brett Cannon wrote:
> >Considering these semantics changed between Python 2 and 3 w/o a
> >discernable benefit (I would consider it a negative as finding a
> >module should not be impacted by syntactic correctness; the full act
> >of importing should be the only thing that cares about that), I would
> >consider it a bug that should be filed.
> 
> The output of imp.find_module() returns an open file io object, and
> it's output feeds directly into to imp.load_module().
> 
> >>> imp.find_module('pydoc')
> (<_io.TextIOWrapper name=4 encoding='utf-8'>,
> '/usr/local/lib/python3.2/pydoc.py', ('.py', 'U', 1))
> 
> So I think the imp.find_module() is suppose to be used when you *do*
> want to do the full act of importing and not for just finding out if
> or where module xyz exists.

in python 2, find_module was usable for such usage, and this is a needed api
for a tool like pylint. Is there another way to do so with python 3?
-- 
Sylvain Thénault                               LOGILAB, Paris (France)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
CubicWeb, the semantic web framework:    http://www.cubicweb.org

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4