Skip to Content
Python 技術手冊 第三版
book

Python 技術手冊 第三版

by lex Martelli, Anna Martelli Ravenscroft, Steve Holden
January 2018
Intermediate to advanced
856 pages
17h 17m
Chinese
GoTop Information, Inc.
Content preview from Python 技術手冊 第三版
229
7
核心內建功能和
標準程式庫模組
built-in
這個詞,在 Python 中的意義不只一個。在多數情境中,一個
built-
in
代表無須
import
述句就能在 Python 程式碼中直接取用的一個物件。前
面「Python 的內建物件」中展示了 Python 用來允許這種直接存取的機制。
Python 中的內建型別(built-in types)包括了數字、序列、字典、集合、
函式(全都涵蓋於第 3 章)、類別(涵蓋於前面的「Python 類別」)、標準
例外類別(涵蓋於前面的「例外物件」),以及模組(涵蓋於前面的「模組
物件」)。後面的「io 模組」涵蓋(v2 中內建的)
file
型別,而「內部型
別」則涵蓋了 Python 內部運作所需的其他一些內建型別。本章額外涵蓋了
核心的內建型別(後面的「內建型別」)並涵蓋模組
builtins
v2 中名為
__builtins__
)中可用的內建函式,在後面的「內建函式」中。
如前面「Python 的內建物件」中所提到的,某些模組之所以被稱為「built-
in」,是因為它們是 Python 標準程式庫不可或缺的部分(雖然需要
import
述句才能取用它們),以區別其他分開的、選擇性的附加模組,也
叫做 Python
擴充功能
extensions
。本章涵蓋一些
核心的
core
內建
模組:也就是後面「sys 模組」中的模組
sys
、「 copy 模組」中的
copy
collections 模組」中的
collections
、「 functools 模組」中的 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

測試驅動開發|使用 Python

測試驅動開發|使用 Python

Harry J.W. Percival

Publisher Resources

ISBN: 9789864766819