Python3 简介

Python 的发展历史、语言特点、典型应用领域与版本演进。

Beginner
Key PointsPython 是解释型、动态类型、自动回收内存的通用语言;语法靠缩进,生态覆盖后端、数据、AI 与自动化。

Python 发展历史

Python was designed by Guido van Rossum around Christmas 1989 and released as 0.9.0 in 1991. The name honours the comedy troupe Monty Python, not the snake.

  • 1991 — Python 0.9.0, first public release
  • 2000 — Python 2.0, list comprehensions and garbage collection
  • 2008 — Python 3.0, deliberate breaking changes
  • 2020 — Python 2.7 end of life; Python 3 only

Python 特点

Python's first design goal is readability: indentation marks blocks and the syntax reads like English. Being interpreted it runs right after an edit; dynamic typing keeps code short at the cost of relying more on tests and type hints.

  • Easy to learn — clean, consistent syntax
  • Interpreted — no build step, fast iteration
  • Dynamically typed — no declarations
  • Batteries included — broad standard library
  • Extensible — interoperates with C/C++
  • Cross-platform — same code everywhere

Python 应用

The ecosystem spans nearly every direction; these are the most common landing zones and their stacks.

DomainTypical stack
Web backendDjango / Flask / FastAPI
Data analysisNumPy / pandas / matplotlib
Machine learningscikit-learn / PyTorch
AutomationAnsible / subprocess
Scrapingrequests / BeautifulSoup
Testingpytest / Selenium

Python 版本进度

Python 3 ships one minor release per year (3.10, 3.11, 3.12 …), each supported for about five years. Start new projects on the current stable release; verify dependency support before upgrading old ones.

Python
import sys

v = sys.version_info
print("major:", v.major)
print("is python 3:", v.major == 3)
print("supports match:", v >= (3, 10))
print("supports walrus:", v >= (3, 8))
Output
major: 3
is python 3: True
supports match: True
supports walrus: True

Friends & Partners