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/2007-April/072518.html below:

[Python-Dev] concerns regarding callable() method

[Python-Dev] concerns regarding callable() method [Python-Dev] concerns regarding callable() methodGuido van Rossum guido at python.org
Sun Apr 8 17:55:26 CEST 2007
On 4/8/07, Paul Pogonyshev <pogonyshev at gmx.net> wrote:
> Guido van Rossum wrote:
> > What if someone passes a callable that doesn't have the expected signature?
>
> Well, I don't know a way to catch such situations now, so removing
> callable() will not make it worse (even if you don't know about hasattr
> trick above.)

My point is that it's futile to use callable() -- even if it passes,
you have no assurance that you actually have a valid callback. So why
bother with it at all? It's counter to the spirit of Python. If
someone passes you a bad callback, they will see a traceback when you
call it. Then they fix their program. That's how it's supposed to
work.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
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