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/2001-January/012095.html below:

[Python-Dev] Is X a (sequence|mapping)?

[Python-Dev] Is X a (sequence|mapping)? [Python-Dev] Is X a (sequence|mapping)?Tim Peters tim.one@home.com
Tue, 23 Jan 2001 17:02:41 -0500
>> 	operator.isMappingType()
>> 	+ some other C style _Check() APIs

[Guido]
> Yes, these should probably be deprecated.  I certainly have never
> used them!  (The operator module doesn't seem to get much use in
> general...

It's used heavily by test_operator.py <wink>.  Outside of that, it's used
maybe three times in the std distribution, nowhere essential; the

    return map(operator.__div__, rgbtuple, _maxtuple)

in Pynche's ColorDB.py is typical.  2.0's

    return [x / 256. for x in rgbtuple]

does the same thing more clearly (_maxtuple is a module constant).

It appeals to functional-language fans and extreme micro-optimizers, so they
don't have to type "lambda" in the simplest cases.  At least
operator.truth(x) is *clearer* than "not not x".

> Was it a bad idea?)

Mixed, but I'd say more bad than good overall.




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