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/2012-February/116776.html below:

[Python-Dev] cpython: Refactor importlib to make it easier to re-implement in C.

[Python-Dev] cpython: Refactor importlib to make it easier to re-implement in C. [Python-Dev] cpython: Refactor importlib to make it easier to re-implement in C.Antoine Pitrou solipsis at pitrou.net
Thu Feb 23 16:43:59 CET 2012
On Thu, 23 Feb 2012 16:18:19 +0100
brett.cannon <python-checkins at python.org> wrote:
>  def _sanity_check(name, package, level):
>      """Verify arguments are "sane"."""
> +    if not hasattr(name, 'rpartition'):
> +        raise TypeError("module name must be str, not {}".format(type(name)))

Why don't you simply use isinstance()?
(bytes objects also have rpartition())

Regards

Antoine.


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