Comments (2)
这。。。我跟你说,这一定是一个由于地球磁场不稳定产生的 bug,哈哈哈哈。
关于 is 和 ==,我觉得还是得严格限制对于 is 的使用,对于那些我们明确知道在 Python 里只有单例的对象才使用 is 来判断完全一致性,比如 None, True, False,以及你定义的任何单例对象。假如我说,我们比起 == 更推荐用 is 的话,会产生比起全部用 == 来说更严重的问题,非常困扰新人:
>>> a = 10987
>>> a is 10987
False
>>> a = 256
>>> a is 256
True
from one-python-craftsman.
谢谢提醒,已经调整文章内容。
from one-python-craftsman.
Related Issues (20)
- blog服务好像挂了.https://www.zlovezl.cn/ HOT 5
- Python suffixed of some code block is missing HOT 1
- To add software craftsmanship manifesto?
- 縮進問題 HOT 1
- 微信公众号图裂了 HOT 1
- 使用namedtuple可以用解包赋值给多个变量 HOT 1
- 推荐添加用在装饰器上的自省函数 inspect.signature 的使用说明 HOT 1
- 第六篇文章“Write Cleaner Python: Use Exceptions”链接已失效 HOT 1
- 现已支持switch case HOT 2
- 关于「使用 try/while/for 中 else 分支」 HOT 1
- 写的很棒 HOT 1
- OOP 原则 HOT 2
- 关于第三章里【常见误区】- 【字符串拼接并不慢】 HOT 1
- 书籍建议 HOT 3
- 有关Monkey Patch HOT 1
- 是否有epub电子书购买渠道? HOT 2
- On Code Repo HOT 2
- On Code in 10-a-good-player-know-the-rules.md HOT 1
- 类型注解来声明类型 HOT 1
- 关于异常处理代码对照示例的疑问
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from one-python-craftsman.