From 638bd16f02f22c81fa9ba34d94c18015c5ccdb16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9A=AE=E6=99=A8?= <362864550@qq.com> Date: Wed, 14 Nov 2018 23:59:59 +0800 Subject: [PATCH] EX.is not ...is (not ...) --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a5d7382..fefcb7f 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ So, here we go... - [> `is` is not what it is!/出人意料的`is`!](#-is-is-not-what-it-is出人意料的is) - [> A tic-tac-toe where X wins in the first attempt!/一蹴即至!](#-a-tic-tac-toe-where-x-wins-in-the-first-attempt一蹴即至) - [> The sticky output function/麻烦的输出](#-the-sticky-output-function麻烦的输出) - - [> `is not ...` is not `is (not ...)`](#-is-not--is-not-is-not-) + - [> `is not ...` is not `is (not ...)`/`is not ...` 不是 `is (not ...)`](#-is-not--is-not-is-not-is-not--不是-is-not-) - [> The surprising comma](#-the-surprising-comma) - [> Backslashes at the end of string](#-backslashes-at-the-end-of-string) - [> not knot!](#-not-knot) @@ -608,7 +608,7 @@ funcs_results = [func() for func in funcs] --- -### > `is not ...` is not `is (not ...)` +### > `is not ...` is not `is (not ...)`/`is not ...` 不是 `is (not ...)` ```py >>> 'something' is not None @@ -617,10 +617,10 @@ True False ``` -#### 💡 Explanation +#### 💡 说明: -- `is not` is a single binary operator, and has behavior different than using `is` and `not` separated. -- `is not` evaluates to `False` if the variables on either side of the operator point to the same object and `True` otherwise. +- `is not` 是个单独的二元运算符, 与分别使用 `is` 和 `not` 不同. +- 如果操作符两侧的变量指向同一个对象, 则 `is not` 的结果为 `False`, 否则结果为 `True`. ---