This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: A string contains an empty string?
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: roniemartinez, serhiy.storchaka, steven.daprano
Priority: normal Keywords:

Created on 2020-04-19 07:14 by roniemartinez, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg366757 - (view) Author: Ronie Martinez (roniemartinez) Date: 2020-04-19 07:14
Testing if an empty string is in a given string returns True. Tried only on Python 3.7 but might exists on other versions.

Python 3.7.6 (default, Mar 13 2020, 18:48:35) 
[Clang 11.0.0 (clang-1100.0.33.17)] on darwin

```
>> "" in "hello"
True
```
msg366758 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-04-19 07:24
Yes, it is.
msg366771 - (view) Author: Steven D'Aprano (steven.daprano) * (Python committer) Date: 2020-04-19 09:26
https://docs.python.org/3/reference/expressions.html#membership-test-operations
History
Date User Action Args
2022-04-11 14:59:29adminsetgithub: 84506
2020-04-19 09:26:26steven.dapranosetnosy: + steven.daprano
messages: + msg366771
2020-04-19 07:24:06serhiy.storchakasetstatus: open -> closed

nosy: + serhiy.storchaka
messages: + msg366758

resolution: not a bug
stage: resolved
2020-04-19 07:14:17roniemartinezcreate