Skip to content

Section: Strain your brain! --> Strings can be tricky sometimes *中有条示例似乎已经不适用了 #13

@RocShi

Description

@RocShi

首先,感谢作者的辛勤劳作,实践中发现Strings can be tricky sometimes/微妙的字符串 *中第2段代码段最后一条示例在我的环境中的运行结果与文中恰恰相反,原文中是这样的:

>>> a, b = "wtf!", "wtf!"
>>> a is b
True

我的环境中是这样的:

$ python3
Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> a, b = "wtf!", "wtf!"
>>> a is b
False

我的操作环境:windows 10企业版(64位操作系统,基于x64处理器),Python 3.7.1(64位)。
请查证。

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions