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/2018-April/152607.html below:

[Python-Dev] <int> in <str>

[Python-Dev] <int> in <str>Ethan Furman ethan at stoneleaf.us
Tue Apr 3 19:34:58 EDT 2018
This behavior was recently brought to my attention [1]:

--> 1 in 'hello'
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
TypeError: 'in <string>' requires string as left operand, not int

However, in any other collection (set, dict, list, tuple, etc), the answer would be False.

Does anyone remember the reason why an exception is raised in the string instance instead of returning False?

--
~Ethan~



[1] https://bugs.python.org/msg314900
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