AI Academy
Promotion
CodeGym University
Learning
Courses
Tasks
Surveys & Quizzes
Games
Help
Schedule
Community
Users
Forum
Chat
Articles
Success stories
Activity
Reviews
Subscriptions
Light theme
Group
Reviews
About us
Start
Start learning
Start learning now
Articles
Authors
All groups
All Articles List
CodeGym
/
Java Blog
/
Learning Python
Learning Python
208 members
Leaderboard
Popular
New
Old
Milan Vucic
Learning Python
June 24, 2026 at 4:17 PM
mypy vs Pyright vs Pyrefly: Choosing a Python Type Checker in 2026
The Python type-checker market changed more in the last 18 months than in the previous decade. mypy and Pyright held a comfortable duopoly through 2024; in May 2026 Meta released Pyrefly 1.0 (written in Rust, 10-50x faster than the incumbents), and Astral's ty (also Rust) followed close behind in alpha.
Milan Vucic
Learning Python
June 23, 2026 at 4:01 PM
Python Type Hints in 2026: What's Worth Adopting (and What's Not)
Type hints in Python have grown from an experimental 2014 addition (PEP 484) into a near-universal baseline by 2026. The major libraries ship types: FastAPI is built on them, Pydantic v2 depends on them, SQLAlchemy 2.0 treats them as the primary API, mypy and Pyright analyze billions of lines of typed Python every day.
Lihu Zhai
Learning Python
June 23, 2026 at 2:26 PM
Python OOP Complete Guide: The 10 Questions That Actually Matter
Most Python OOP tutorials make one of two mistakes: they stop at "class Dog: pass" and call it complete, or they dump every dunder and metaclass concept on the reader without a path through. This guide is built around the 10 questions that actually come up when you write real Python code.
Lihu Zhai
Learning Python
June 22, 2026 at 2:03 PM
What Metaclasses Actually Are in Python (and When You Genuinely Need One)
"Metaclasses are deeper magic than 99% of users should ever worry about. If you wonder whether you need them, you don't (the people who actually need them know with certainty that they need them, and don't need an explanation about why)." That's Tim Peters, in one of the most-quoted Python aphorisms ever written.
Lihu Zhai
Learning Python
June 22, 2026 at 1:08 PM
@dataclass in Python: From Boilerplate to Frozen and Slots
Before PEP 557 landed in Python 3.7, every value class meant writing the same five methods by hand: __init__ to assign the fields, __repr__ for debuggable output, __eq__ for value comparison, often __hash__ to keep dict-key usage working, sometimes the ordering dunders for sorting. Thirty lines of boilerplate for what felt like four attributes.
Lihu Zhai
Learning Python
June 19, 2026 at 12:47 PM
Abstract Base Classes (ABC) and Protocols in Python: Interfaces Done Right
Python has two ways to express the idea "this class implements an interface", and they look superficially similar but enforce the contract at completely different moments. Abstract Base Classes (abc.ABC + @abstractmethod) have been around since Python 2.6 (PEP 3119, 2007); they use nominal subtyping, where a class IS an implementer only if it inherits from the ABC, and enforce the contract at instantiation time by raising TypeError
Lihu Zhai
Learning Python
June 19, 2026 at 11:40 AM
Composition vs Inheritance in Python: When to Favor Each
The Gang of Four's Design Patterns (1994) buried one rule in the introduction so deep that most readers miss it, even though it's the most-cited line in the book: favor object composition over class inheritance. Thirty years later it's still the right default, and Python's culture has internalized it more than Java's or C++'s.
Lihu Zhai
Learning Python
June 18, 2026 at 9:03 AM
The 12 Magic Methods (Dunders) You'll Actually Use in Python
Python has roughly 100 dunder methods documented in the Data Model reference, but you'll use about 12 of them daily and the rest almost never. Beginners worry about memorizing all of them; intermediate developers worry about which to implement on custom classes.
Lihu Zhai
Learning Python
June 18, 2026 at 8:45 AM
@property in Python: Getters, Setters, and Computed Attributes Done Right
The fastest way to spot a Python programmer who just came from Java: every class has a private _name, a get_name(), and a set_name(value). It works, but it's noise. Python doesn't need any of that. You write self.name = "Rex" directly.
Lihu Zhai
Learning Python
June 17, 2026 at 2:33 PM
super().__init__() and MRO Explained: Inheritance Without the Diamond Problem
The shortest accurate description of super() comes from Raymond Hettinger's "Super Considered Super!" blog post and his PyCon 2015 talk: super() doesn't call your ancestors — it calls your children's ancestors. That line sounds confusing until you understand the Method Resolution Order (MRO), which is the linear list Python
Lihu Zhai
Learning Python
June 17, 2026 at 1:18 PM
staticmethod vs classmethod vs instance method: When to Use Each in Python
Python has three method types, and the difference comes down to one question: what does Python pass as the first argument when you call the method? Instance methods (the default) receive the instance. Classmethods receive the class. Staticmethods receive nothing extra.
Lihu Zhai
Learning Python
June 17, 2026 at 11:08 AM
When to Use OOP in Python (and When to Skip It): A Decision Framework Backed by "Stop Writing Classes"
Python isn't Java. Functions are first-class citizens, modules behave like singletons, dataclasses give you data containers with three lines, and the PSF tutorial doesn't even introduce classes until chapter 9. So the question every Python developer eventually faces isn't "should I learn OOP?
Show more
1
2
3
4
5
6
7
...
10
Please enable JavaScript to continue using this application.