Skip to content
David Liu edited this page Jul 30, 2022 · 22 revisions

naming-conventions

  • Python import 并非只是把一个文本插入另一个文本而已。程序在第一次导入指定文件时,会执行如下steps: 1. 找到模块文件 2. compile into bytecode 3. 执行模块的代码。在这之后,导入相同模块时,会跳过这些steps,而只提取内存中已加载的模块对象。已加载的模块存储在sys.modules表对象中。

pylint

  • Auto formatter: autopep8
    • pip install --upgrade autopep8

logging

请注意,根记录器的默认级别为 WARNING

type

Python 复数 4+3j 的类型为 ‘<class 'complex'>’

Python3 中,bool 是 int 的子类,True 和 False 可以和数字相加, True==1、False==0 会返回 True

Latest compiled version

  • 3.12.9+
  • 3.11.11
  • 3.10.11
Clone this wiki locally