Skip to main content
ProductsDesktop toolsTASTECADDrawing reviewTASTEFILESFile managementTASTEFTPFile transferTASTESSHRemote workspaceTASTEZIPCompression and extractionTASTEWINMFile managementDeveloper toolsTASTECODERust integrated development environmentTASTESTUDIOIntegrated development and test environmentTASTEETLData integration (ETL)ServersTASTEREMOTERemote desktop serverTASTEGEOGeospatial serverTASTEMAILMail workspaceInvestingTASTESTOCKStock auto-trading desktop appGet startedDownloadsDocumentationBuyAll products
Marketplace
News
TechNewsToday's dev newsDeveloper docsProgramming languagesRustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartWeb front-end frameworksNext.jsReactVue.js · NuxtSvelteKitAngularServer frameworksSpring BootDjangoFastAPIASP.NET CoreNestJS · ExpressApp & desktop frameworksTauriFlutterReact NativeElectronAlgorithmsAlgorithm basicsCore algorithmsAdvanced algorithmsPractical algorithms
CommunityProjectsDevelopment logsPromptsAI tool issuesShowcaseCommunity guide
Work with usTech transferWebsite buildDesktop app buildRelease and payment pipelineSales partnerContact
ServicesRemote desktopCustom installer packages
TASTEDEV
Products

Desktop tools

TASTECADComplex drawings, opened with easeTASTEFILESJust the files you need, as fast as possibleTASTEFTPThe tidiest path for your filesTASTESSHA stronger link between you and your serversTASTEZIPPack faster, unpack saferTASTEWINMA keyboard-first file manager with two panes

Developer tools

TASTECODEEdit, build, debug and test Rust apps in one windowTASTESTUDIOFrom editing to remote tests and approved AI fixesTASTEETLMove data while you watch the values

Servers

TASTEREMOTEA remote desktop you run on your own serverTASTEGEORebuilding a GeoServer-compatible geospatial server in RustTASTEMAILTake back control of your email

Investing

TASTESTOCKStock auto-trading that follows the rules you set: when, and what

Get started

DownloadsLatest builds of every productDocsHow to use each productBuySubscriptions and perpetual licencesAll productsEvery product at a glance
All products
MarketplaceNews
Tech

News

Today's dev newsOfficial announcements on languages, frameworks, GitHub and AIDeveloper docsGuides to languages, frameworks and algorithms

Programming languages

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

Frameworks

Web front-end frameworksNext.jsReactVue.js · NuxtSvelteKitAngular
Server frameworksSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
App & desktop frameworksTauriFlutterReact NativeElectron

Algorithms

Algorithm basicsComplexity analysis · Sorting · Searching · Basic data structures · Trees and heapsCore algorithmsGraph traversal · Shortest paths & minimum spanning trees · Dynamic programming · Greedy algorithms · Divide and conquer · BacktrackingAdvanced algorithmsString algorithms · Math and number theory · Bit manipulation · Segment trees · Union-findPractical algorithmsCoding interview strategy · LRU cache · Rate limiting · Consistent hashing
All development docs
Community
ProjectsDiscover builders and their workDevelopment logsDecisions and lessons learnedPromptsReusable instructionsAI tool issuesProblems and workarounds for Claude, Codex, GeminiShowcaseFinished resultsCommunity guideHow we build in the open
Work with us
Tech transferNative apps in Rust and eguiWebsite build10 languages, accounts, docs and downloadsDesktop app buildRust and egui, no WebViewRelease and payment pipelineSigning, MSI, deb, rpm, AppImage, hashesSales partnerRecommend us and earn 30%ContactBuilds, partnerships and investment
Services
Remote desktopReach your computer from a browserCustom installer packagesOnly the features you need, settings preloaded
Buy
EN
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
Log in
Log in
TASTEDEV

From small tools to better development.

support@tastedev.netSupport TASTEDEV
ProductsProduct lineupBuyDocsDownloadsMarketplaceSupport
CommunityProjectsDevelopment logsPromptsAI tool issuesShowcase
PoliciesAbout usPrivacy policyTerms of serviceSubscription termsRefund policyCommunity guidelines
AccountLog inSign up
Visitors
Today
Yesterday
Total views
Company
GXSOFT
Representative
CHOI YOUNG GU
Business registration number
853-44-00368
Address
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
Phone
+82-10-4404-1523
Email
whitecalvin@tastedev.net
Privacy officer
CHOI YOUNG GU

© 2026 TASTEDEVProduct information is based on verified development sources.Released · improving

Python docs
Python
Getting StartedSyntax BasicsTypes and DataModules and PackagesErrors and TestingKey Concepts
Discussions

Python guide · 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 nums.copy() or dict(ages) when you need independence.

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.
Questions about this chapter?
Previous chapterSyntax BasicsNext chapterModules and Packages

0 comments

Top commentsNewest first

Sign in · Sign in to leave a comment.