本文へスキップ
製品デスクトップツールTASTECAD図面の確認TASTEFILESファイル管理TASTEFTPファイル転送TASTESSHリモートワークスペースTASTEZIP圧縮と展開TASTEWINMファイル管理開発ツールTASTECODERust 統合開発環境TASTESTUDIO統合開発・テスト環境TASTEETLデータ統合(ETL)サーバーTASTEREMOTEリモートデスクトップサーバーTASTEGEO空間情報サーバーTASTEMAILメールワークスペース投資TASTESTOCK株式自動売買デスクトップアプリはじめるダウンロードドキュメント購入すべての製品
マーケットプレイス
ニュース
技術ニュース今日の開発ニュース開発ドキュメントプログラミング言語RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartWebフロントエンド フレームワークNext.jsReactVue.js · NuxtSvelteKitAngularサーバー フレームワークSpring BootDjangoFastAPIASP.NET CoreNestJS · Expressアプリ・デスクトップ フレームワークTauriFlutterReact NativeElectronアルゴリズムアルゴリズムの基礎主要アルゴリズム発展アルゴリズム実務のアルゴリズム
コミュニティプロジェクト開発ログプロンプトAIツールの問題ショーケースコミュニティガイド
協業技術移転ウェブサイト構築デスクトップアプリ構築リリース・決済パイプライン販売パートナーお問い合わせ
サービスリモートデスクトップインストールパッケージのカスタマイズ
TASTEDEV
製品

デスクトップツール

TASTECAD複雑な図面を、軽やかにひらくTASTEFILES必要なファイルだけを、最速でTASTEFTPファイルが行き交う、いちばん端正な道TASTESSHサーバーとあなたを、より確かにつなぐTASTEZIPより速くまとめ、より安全にひらくTASTEWINM2つの画面で整理する、キーボード中心のファイルマネージャー

開発ツール

TASTECODERust アプリの編集・ビルド・デバッグ・テストまでひとつのウィンドウでTASTESTUDIO編集からリモートテスト、承認した AI 修正までTASTEETL値を見ながら、データを運ぶ

サーバー

TASTEREMOTE自社サーバーで運用するリモートデスクトップTASTEGEOGeoServer 互換の空間情報サーバーを Rust で作り直しますTASTEMAILメールの主導権を、もう一度自分の手に

投資

TASTESTOCKいつ・何を。自分で決めたルールどおりに動く株式自動売買

はじめる

ダウンロード全製品の最新版ドキュメント各製品の使い方購入サブスクリプション・永久ライセンスすべての製品全製品を一覧で
すべての製品
マーケットプレイスニュース
技術

ニュース

今日の開発ニュース言語・フレームワーク・GitHub・AI の公式発表開発ドキュメント言語・フレームワーク・アルゴリズムのガイド

プログラミング言語

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

フレームワーク

Webフロントエンド フレームワークNext.jsReactVue.js · NuxtSvelteKitAngular
サーバー フレームワークSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
アプリ・デスクトップ フレームワークTauriFlutterReact NativeElectron

アルゴリズム

アルゴリズムの基礎計算量解析 · ソート · 探索 · 基本データ構造 · 木構造とヒープ主要アルゴリズムグラフ探索 · 最短経路と最小全域木 · 動的計画法 · 貪欲法 · 分割統治法 · バックトラッキング発展アルゴリズム文字列アルゴリズム · 数学と整数論 · ビット演算 · セグメント木 · Union-Find実務のアルゴリズムコーディング面接対策 · LRUキャッシュ · レート制限 · コンシステントハッシュ法
開発ドキュメントをすべて見る
コミュニティ
プロジェクトビルダーと作品を探す開発ログ決定と試行錯誤プロンプト再利用できる指示AIツールの問題Claude・Codex・Gemini の問題と回避策ショーケース完成した成果コミュニティガイドオープンにつくる方法
協業
技術移転Rust・egui でネイティブアプリを作るウェブサイト構築10言語、アカウント、ドキュメントとダウンロードデスクトップアプリ構築Rust・egui、WebView なしリリース・決済パイプライン署名・MSI・deb・rpm・AppImage・ハッシュ販売パートナー紹介して決済額の30%お問い合わせ構築・提携・投資のご相談
サービス
リモートデスクトップブラウザから自分のパソコンへインストールパッケージのカスタマイズ必要な機能だけ、設定は事前に
購入
JA
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
ログイン
ログイン
TASTEDEV

小さなツールから、より良い開発へ。

support@tastedev.netTASTEDEVを支援
製品製品ラインナップ購入ドキュメントダウンロードマーケットプレイスサポート
コミュニティプロジェクト開発ログプロンプトAIツールの問題ショーケース
ポリシー会社概要プライバシーポリシー利用規約サブスクリプション規約返金ポリシーコミュニティガイドライン
アカウントログイン新規登録
訪問者
今日
昨日
累計閲覧
商号
GXSOFT
代表者
CHOI YOUNG GU
事業者登録番号
853-44-00368
所在地
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
電話
+82-10-4404-1523
メール
whitecalvin@tastedev.net
個人情報保護責任者
CHOI YOUNG GU

© 2026 TASTEDEV製品情報は検証済みの開発ソースに基づいています。リリース・改善中

Python ドキュメント
Python
Getting StartedSyntax BasicsTypes and DataModules and PackagesErrors and TestingKey Concepts
ディスカッション

Python ガイド · 3/6

Types and Data

この章は現在、英語でのみ提供しています。

Python ships with a small set of core types and four built-in collections that cover most day-to-day data handling. This chapter shows when to reach for each one, how to define your own types with classes and dataclasses, and how type hints make intent explicit without changing how code runs.

Core types

TypeExamplesNotes
int42, 1_000_000Integers of unlimited size
float3.14, 1e-3Double-precision floating point
str"hello", 'text'Immutable Unicode text
boolTrue, FalseBooleans
NoneNoneThe single value meaning "nothing here"
7 / 2      # 3.5  (true division always gives a float)
7 // 2     # 3    (floor division)
7 % 2      # 1    (remainder)
2 ** 100   # big integers are exact, no overflow

text = "Python"
text[0]        # 'P'
text[-1]       # 'n'
text[1:4]      # 'yth'  (slicing)
"py" in text.lower()  # True

value = None
if value is None:      # compare with None using is, not ==
    print("no value")

Empty strings, zero, empty collections and None are all falsy. That is why if items: reads naturally as "if the list has anything in it".

Collections

The four built-in collections each have a clear job:

  • list: an ordered, mutable sequence. The workhorse.
  • tuple: ordered but immutable. Good for fixed groupings such as coordinates or multiple return values.
  • dict: a mapping from keys to values. It remembers insertion order.
  • set: an unordered collection of unique values, with fast membership tests and set algebra.
nums = [3, 1, 2]
nums.append(4)
nums.sort()             # [1, 2, 3, 4]

point = (10, 20)
x, y = point            # tuple unpacking

ages = {"mina": 31, "joon": 28}
ages["sara"] = 25
ages.get("tom", 0)      # 0 when the key is missing
for name, age in ages.items():
    print(name, age)

tags = {"python", "web", "python"}
tags                    # {'python', 'web'}
tags & {"web", "api"}   # {'web'}  (intersection)

Lists and dicts are mutable, and assignment never copies. Two names can refer to the same list, so a change through one is visible through the other. Make an explicit copy with or when you need independence.

この章について質問がありますか?
前の章Syntax Basics次の章Modules and Packages
nums.copy()
dict(ages)

Classes and dataclasses

Define a class with class. The __init__ method initializes new instances, and every method receives the instance itself as its first parameter, conventionally named self.

class Account:
    def __init__(self, owner: str, balance: int = 0) -> None:
        self.owner = owner
        self.balance = balance

    def deposit(self, amount: int) -> None:
        if amount <= 0:
            raise ValueError("amount must be positive")
        self.balance += amount

    def __repr__(self) -> str:
        return f"Account({self.owner!r}, {self.balance})"


acc = Account("mina")
acc.deposit(100)
print(acc)   # Account('mina', 100)

When a class mostly exists to hold data, the standard dataclasses module removes the boilerplate. List the fields with type hints and you get __init__, __repr__ and __eq__ generated for you. Pass frozen=True to make instances immutable.

from dataclasses import dataclass, field


@dataclass
class Order:
    id: int
    customer: str
    items: list[str] = field(default_factory=list)
    paid: bool = False


@dataclass(frozen=True)
class Point:
    x: float
    y: float


order = Order(1, "mina")
order.items.append("book")
print(order)                       # Order(id=1, customer='mina', items=['book'], paid=False)
Point(1, 2) == Point(1, 2)         # True

Type hints

Python is dynamically typed, but you can annotate variables, parameters and return values. The interpreter does not enforce these hints at runtime; instead editors use them for completion, and static checkers such as mypy and Pyright use them to catch mistakes before the code ever runs. The payoff grows with the size of the codebase.

from typing import Optional


def find_user(users: dict[str, int], name: str) -> int | None:
    return users.get(name)


def average(values: list[float]) -> float:
    return sum(values) / len(values) if values else 0.0


scores: list[int] = [90, 85]
lookup: dict[str, tuple[int, int]] = {"origin": (0, 0)}
maybe: Optional[str] = None   # same as str | None
python -m pip install mypy
mypy app.py

Summary

  • The core types are int, float, str, bool and None; test for None with is.
  • Pick list for changing sequences, tuple for fixed groups, dict for lookups and set for uniqueness.
  • Use classes for objects with behavior and @dataclass for plain data containers.
  • Type hints do not change runtime behavior, but editors and checkers turn them into early bug detection.

コメント 0件

人気のコメント順新しい順

ログイン · ログインするとコメントできます。