# subclass

In object-oriented programming, a subclass is a class derived from another class that inherits members from its superclass.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Object-Oriented Programming in Python vs Java

DevFeed: [Object-Oriented Programming in Python vs Java](<https://devfeed.tech/articles/object-oriented-programming-in-python-vs-java-110727.md>)

Original publisher: [Read original article](<https://realpython.com/oop-in-python-vs-java/>)

Author: Jon Fincher

Published: 2026-10-31T14:00:00Z

Content type: comparison

Language: en

Sources: [Real Python](<https://devfeed.tech/sources/real-python.md>)

Topics: [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Java](<https://devfeed.tech/topics/java.md>), [Python](<https://devfeed.tech/topics/python.md>), [class](<https://devfeed.tech/topics/class.md>), [object](<https://devfeed.tech/topics/object.md>), [Inheritance](<https://devfeed.tech/topics/inheritance.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>), [subclass](<https://devfeed.tech/topics/subclass.md>), [constructor](<https://devfeed.tech/topics/constructor.md>)

Tags: [access-control](<https://devfeed.tech/tags/access-control.md>), [car](<https://devfeed.tech/tags/car.md>), [classes](<https://devfeed.tech/tags/classes.md>), [code](<https://devfeed.tech/tags/code.md>), [color](<https://devfeed.tech/tags/color.md>), [compare](<https://devfeed.tech/tags/compare.md>), [comparison](<https://devfeed.tech/tags/comparison.md>), [compilation-error](<https://devfeed.tech/tags/compilation-error.md>), [complete](<https://devfeed.tech/tags/complete.md>), [composition](<https://devfeed.tech/tags/composition.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [java](<https://devfeed.tech/tags/java.md>), [knowledge](<https://devfeed.tech/tags/knowledge.md>), [learn](<https://devfeed.tech/tags/learn.md>), [object](<https://devfeed.tech/tags/object.md>), [object-oriented](<https://devfeed.tech/tags/object-oriented.md>), [object-oriented-programming](<https://devfeed.tech/tags/object-oriented-programming.md>), [programming](<https://devfeed.tech/tags/programming.md>), [python](<https://devfeed.tech/tags/python.md>), [vs](<https://devfeed.tech/tags/vs.md>)

### AI overview

The article shows how Java OOP concepts translate into Python and where the languages differ. Java declares typed attributes in class bodies, commonly keeps them private behind getters and setters, and restricts classes to single inheritance while allowing shared behavior through interfaces. Python creates instance attributes with `self` in `__init__`, exposes them by default, and offers properties for controlled access; underscore naming conventions signal non-public attributes but do not provide Java-style access control. Python also supports multiple inheritance and duck typing, while Java uses interface types for polymorphic interchangeability. Both languages provide reflection and type checks, though the article describes Python's `dir()`, `getattr()`, and `callable()` workflow as simpler than Java's reflection APIs. Python dunder methods can customize representations and overload operators; the article notes Java has no comparable operator overloading. Examples use a `Car` class to illustrate these mechanisms and practical pitfalls, including class versus instance attributes.

### Source excerpt

Compare Python vs Java for object-oriented programming and learn how to apply your Java knowledge of classes and objects to Python in a Pythonic way.

## Object-Oriented Harness: Evolving Agent Harnesses through Object-Oriented Design

DevFeed: [Object-Oriented Harness: Evolving Agent Harnesses through Object-Oriented Design](<https://devfeed.tech/articles/object-oriented-harness-evolving-agent-harnesses-through-object-oriented-design-93724.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2610.28380>)

Author: Gaotang Li, Bhavana Dalvi Mishra, Yifei Ming, Yanfei Chen, Zhongying CuiZhu, Lesly Miculicich, Long T. Le, Rui Meng, Chun-Liang Li, Hanghang Tong, Chen-Yu Lee, Tomas Pfister

Published: 2026-10-21T04:00:00Z

Content type: article

Language: en

Sources: [arXiv: Software Engineering](<https://devfeed.tech/sources/arxiv-software-engineering.md>)

Topics: [Agent Harness](<https://devfeed.tech/topics/agent-harness.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [subclass](<https://devfeed.tech/topics/subclass.md>), [Inheritance](<https://devfeed.tech/topics/inheritance.md>), [class](<https://devfeed.tech/topics/class.md>)

Tags: [agent-harnesses](<https://devfeed.tech/tags/agent-harnesses.md>), [benchmarks](<https://devfeed.tech/tags/benchmarks.md>), [cs-cl](<https://devfeed.tech/tags/cs-cl.md>), [cs-se](<https://devfeed.tech/tags/cs-se.md>), [design](<https://devfeed.tech/tags/design.md>), [hierarchy](<https://devfeed.tech/tags/hierarchy.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [object-oriented](<https://devfeed.tech/tags/object-oriented.md>), [performance](<https://devfeed.tech/tags/performance.md>), [router](<https://devfeed.tech/tags/router.md>), [routing](<https://devfeed.tech/tags/routing.md>)

### AI overview

OO-Harness addresses varied task needs by evolving a hierarchy of specialized executable harnesses. During training, an evolution agent uses execution records to create harness subclasses that inherit from a base or existing specialized harness. At test time, a router applies lessons learned during training to select a harness for each task. On three long-horizon benchmarks covering business workflows, workspace tasks, and tool use, it achieved the best performance among the compared methods, with an absolute improvement of up to 15% over the base. The supplied abstract does not specify benchmark details or the ablation findings.

### Source excerpt

arXiv:2610.28380v1 Announce Type: cross Abstract: Agent harnesses are executable code that specifies the prompts, tools, and control flow around a language model. A single global harness can struggle with heterogeneous tasks that require different execution strategies. In this work, we introduce Object-Oriented Harness (OO-Harness), a harness optimization framework that evolves a hierarchy of executable harness classes using object-oriented design. During training, an evolution agent uses execution records to create a family of specialized harnesses, each implemented as a subclass of the base or an existing specialized harness via inheritance. At test time, a harness router uses routing lessons accumulated during training to select a specific harness for each task. Across three long-horizon benchmarks spanning business workflows, workspace tasks, and tool use, OO-Harness achieves the best performance among the compared methods, with an absolute improvement of up to 15% over the base. Extensive ablation studies examine the contributions of its core components.

## Representative Line: A Diamond in the Rough

DevFeed: [Representative Line: A Diamond in the Rough](<https://devfeed.tech/articles/representative-line-a-diamond-in-the-rough-87231.md>)

Original publisher: [Read original article](<https://thedailywtf.com/articles/a-diamond-in-the-rough>)

Author: Remy Porter

Published: 2026-10-14T06:30:00Z

Content type: article

Language: en

Sources: [The Daily WTF](<https://devfeed.tech/sources/the-daily-wtf.md>)

Topics: [Inheritance](<https://devfeed.tech/topics/inheritance.md>), [class](<https://devfeed.tech/topics/class.md>), [subclass](<https://devfeed.tech/topics/subclass.md>)

Tags: [classes](<https://devfeed.tech/tags/classes.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [representative-line](<https://devfeed.tech/tags/representative-line.md>)

### AI overview

The article explains C++ virtual inheritance as a way to address the diamond problem, then describes code where using virtual inheritance on a final class has no effect because the class cannot be inherited from.

### Source excerpt

Mandy's co-worker recently learned about virtual inheritance in C++. It's become their new favorite button to push, and they only use virtual inheritance. Virtual inheritance is one workaround for the "diamond problem", where you have an inheritance tree that "recombines" via multiple inheritance: when a child class has a Hapsburg-esque parentage, it's hard to decide which inherited methods are being invoked or overridden. In C++, imagine you have class A, which gets derived into classes B and C. Class D then uses multiple inheritance to inherit from B and C. In practice, this means that D inherits from A twice, and would have two internal copies of all of A's members. If, on the other hand, you have B and C inherit virtually (class B : public virtual A), then class D will only actually inherit a single copy of A. If you're reading this and going, "Boy, this just sounds like another reason to avoid multiple inheritance," you're probably right. The important thing, though, is inheriting virtually impacts how your child classes will inherit. It only matters if you have child classes. Which brings us back to Mandy's co-worker. He read somewhere that defaulting to virtual inheritance all the time was safer, so he did that all the time. All. The. Time. Including in this case: class SomeSpecificDerivedClass final : public virtual SomeBaseClass The class here is marked final. It can't be inherited from. The use of virtual accomplishes nothing. [Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!

## Benchmarks Are Free Now

DevFeed: [Benchmarks Are Free Now](<https://devfeed.tech/articles/benchmarks-are-free-now-20533.md>)

Original publisher: [Read original article](<https://code.dblock.org/2026/08/15/benchmarks-are-free-now.html>)

Author: Daniel Doubrovkine (dblock@dblock.org)

Published: 2026-08-15T00:00:00Z

Content type: opinion

Language: en

Sources: [Daniel Doubrovkine](<https://devfeed.tech/sources/daniel-doubrovkine.md>)

Topics: [Benchmark](<https://devfeed.tech/topics/benchmark.md>), [subclass](<https://devfeed.tech/topics/subclass.md>), [superclass](<https://devfeed.tech/topics/superclass.md>), [Tool](<https://devfeed.tech/topics/tool.md>), [GitHub Copilot Profiler Agent](<https://devfeed.tech/topics/github-copilot-profiler-agent.md>)

Tags: [agent](<https://devfeed.tech/tags/agent.md>), [ai](<https://devfeed.tech/tags/ai.md>), [benchmarks](<https://devfeed.tech/tags/benchmarks.md>), [caching](<https://devfeed.tech/tags/caching.md>), [class](<https://devfeed.tech/tags/class.md>), [copilot](<https://devfeed.tech/tags/copilot.md>), [cost](<https://devfeed.tech/tags/cost.md>), [dispatch](<https://devfeed.tech/tags/dispatch.md>), [exhaustive](<https://devfeed.tech/tags/exhaustive.md>), [fast](<https://devfeed.tech/tags/fast.md>), [free](<https://devfeed.tech/tags/free.md>), [hash](<https://devfeed.tech/tags/hash.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [performance](<https://devfeed.tech/tags/performance.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [script](<https://devfeed.tech/tags/script.md>), [speed](<https://devfeed.tech/tags/speed.md>), [subclass](<https://devfeed.tech/tags/subclass.md>), [test](<https://devfeed.tech/tags/test.md>), [tests](<https://devfeed.tech/tags/tests.md>), [time](<https://devfeed.tech/tags/time.md>)

### AI overview

A benchmark generated with Copilot CLI exposed a performance regression in ruby-enum's inheritance fix: subclass lookups repeatedly rebuilt merged enum hashes, making a one-level subclass's calls roughly 5x slower than base-class calls, with deeper inheritance slower still. Tests had caught no issue because they checked correctness, not speed. The author says fix #60 memoized the merged hash and invalidated the cache when a new entry was added; afterward, subclass lookups were indistinguishable from base-class lookups regardless of depth. Further benchmarks found constant access as fast as plain Ruby, hash-backed lookups about 3-5x slower than direct calls, and the exhaustive matcher 50-100x slower than a native statement. The excerpt says these measurements were added to the README's Performance section.

### Source excerpt

My previous post walked through four bugs in ruby-enum, a gem I maintain, all stemming from the fact that class-level instance variables aren't inherited by subclasses. The third fix, #59, made keys, key?, value?, key, value, to_h, parse and each walk up superclass and merge in a parent's enums, so a subclass would see everything its ancestors defined. It was correct, fully tested, and shipped. It also made every one of those methods roughly 5x slower on any subclass. def _enum_hash if superclass < Ruby::Enum superclass.send(:_enum_hash).merge(_own_enum_hash) else _own_enum_hash end end This recomputes the merged hash, walking the entire ancestor chain, on every single call. There's no caching. A one-level subclass calling .value pays for building a brand new hash, on top of the superclass doing the same, every time. The test suite didn't notice because tests check correctness, not speed, and correctness was fine. I only found this because I asked Copilot CLI to add a benchmark script comparing lookups at different inheritance depths, mostly out of curiosity about how the "Benchmarks" section of the README would read next to the new feature. It took one prompt and about a minute to get a working script: class Colors include Ruby::Enum define :RED, 'red' define :GREEN, 'green' end class SubColors < Colors define :BLUE, 'blue' end class SubSubColors < SubColors define :YELLOW, 'yellow' end benchmark('base class (no inheritance)', n) { Colors.value(:RED) } benchmark('subclass (1 level)', n) { SubColors.value(:RED) } benchmark('sub-subclass (2 levels)', n) { SubSubColors.value(:RED) } The first run told the story immediately: a 1-level subclass's .value calls took roughly 5x as long as the base class, and a 2-level subclass was worse still. Nobody had written this benchmark before merging #59 because writing a throwaway benchmark script used to feel like more ceremony than it was worth for a one-off performance check. Now it's a single sentence to an agent, and the scri

## Ruby Instance Variables Are Not Inherited (and Why That Breaks Your DSL)

DevFeed: [Ruby Instance Variables Are Not Inherited (and Why That Breaks Your DSL)](<https://devfeed.tech/articles/ruby-instance-variables-are-not-inherited-and-why-that-breaks-your-dsl-20532.md>)

Original publisher: [Read original article](<https://code.dblock.org/2026/08/14/instance-variables-are-not-inherited-and-why-that-breaks-your-dsl.html>)

Author: Daniel Doubrovkine (dblock@dblock.org)

Published: 2026-08-14T00:00:00Z

Content type: article

Language: en

Sources: [Daniel Doubrovkine](<https://devfeed.tech/sources/daniel-doubrovkine.md>)

Topics: [Ruby](<https://devfeed.tech/topics/ruby.md>), [subclass](<https://devfeed.tech/topics/subclass.md>), [software-development](<https://devfeed.tech/topics/software-development.md>), [Ruby on Rails](<https://devfeed.tech/topics/ruby-on-rails.md>)

Tags: [class](<https://devfeed.tech/tags/class.md>), [dsl](<https://devfeed.tech/tags/dsl.md>), [enum](<https://devfeed.tech/tags/enum.md>), [enums](<https://devfeed.tech/tags/enums.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [pull-requests](<https://devfeed.tech/tags/pull-requests.md>), [rails](<https://devfeed.tech/tags/rails.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [subclass](<https://devfeed.tech/tags/subclass.md>), [variables](<https://devfeed.tech/tags/variables.md>)

### AI overview

Four ruby-enum fixes in version 1.2.0 address class-level instance variables that Ruby subclasses do not inherit. Re-including the module could either retain stale enum keys after a class reload or erase a parent's enums; resetting state fixes the reload case but must avoid wiping inherited data. A subclass that defines no enums also had methods that crashed because its own enum hash was unset. The fixes first added a lazy reader defaulting to an empty hash, then updated eight methods to walk ancestors and merge inherited enums, with subclass definitions taking precedence. The excerpt ends while explaining this approach.

### Source excerpt

The ruby-enum gem is a small library I maintain that adds enum-like behavior to a class via include Ruby::Enum and define :KEY, value. Four pull requests landed against it recently, each fixing a different symptom, and all four turned out to be the same underlying bug: class-level instance variables set in a module's included hook are not inherited by subclasses the way you might expect. All of these fixes shipped in ruby-enum 1.2.0. Ruby::Enum stores its keys and values in instance variables on the class itself, set up when the module is included. def self.included(base) base.extend ClassMethods base.instance_variable_set(:@_enum_hash, {}) base.instance_variable_set(:@_enums_by_value, {}) end This works fine for a single class. It gets interesting the moment subclasses or class reloading show up. A user opened #56, reporting DuplicateKeyError from a Rails console after a class that had already defined its enums got reloaded. It reproduces without Rails. class_body = proc do include Ruby::Enum define :RED, 'red' end Colors = Class.new(&class_body) Colors.class_eval(&class_body) # raises DuplicateKeyError Rails' development-mode autoloader re-evaluates a class body, and the second define :RED sees @_enum_hash still holding RED from the first load, so the duplicate-key check fires. The fix clears the hash whenever Ruby::Enum is included, rather than assuming it's always a fresh class. The contributor that reported the problem and submitted the fix also caught a sneakier variant: a subclass that redundantly re-includes Ruby::Enum (include is supposed to be idempotent, right?) was wiping out enums inherited from its parent, because included unconditionally reset the instance variables: class OtherSecondSubclass < FirstSubclass include Ruby::Enum # redundant, but shouldn't lose FirstSubclass's enums define :MAGENTA, 'magenta' end Thanks, Nazar, for tracking both of these down with tests. Months later, #49 surfaced a related crash: a subclass that never calls define itsel

## Contravariance

DevFeed: [Contravariance](<https://devfeed.tech/articles/contravariance-25010.md>)

Original publisher: [Read original article](<https://typealias.com/concepts/contravariance/>)

Author: author@typealias.com (Dave Leeds)

Published: 2017-11-17T01:58:28Z

Content type: article

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Contravariance](<https://devfeed.tech/topics/contravariance.md>), [generic programming](<https://devfeed.tech/topics/generic-programming.md>), [Type Parameter](<https://devfeed.tech/topics/type-parameter.md>), [Inheritance](<https://devfeed.tech/topics/inheritance.md>), [subclass](<https://devfeed.tech/topics/subclass.md>), [class](<https://devfeed.tech/topics/class.md>)

Tags: [class](<https://devfeed.tech/tags/class.md>), [classes](<https://devfeed.tech/tags/classes.md>), [contravariance](<https://devfeed.tech/tags/contravariance.md>), [function](<https://devfeed.tech/tags/function.md>), [functions](<https://devfeed.tech/tags/functions.md>), [generic](<https://devfeed.tech/tags/generic.md>), [generics](<https://devfeed.tech/tags/generics.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [invariant](<https://devfeed.tech/tags/invariant.md>), [java](<https://devfeed.tech/tags/java.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [programming](<https://devfeed.tech/tags/programming.md>), [subtype](<https://devfeed.tech/tags/subtype.md>), [type-parameter](<https://devfeed.tech/tags/type-parameter.md>), [types](<https://devfeed.tech/tags/types.md>), [variance](<https://devfeed.tech/tags/variance.md>)

### AI overview

Contravariance reverses the subtype relationship of a generic type's parameter: if Dog is a subtype of Animal, a contravariant generic for Animal can be used where one for Dog is expected. The excerpt says to mark the type parameter with the language's contravariance annotation; without it, the generic is invariant. The tradeoff is that an instance cannot return a result of type T, since it promises only to accept values of that type. The excerpt also notes that covariant return types are allowed in many languages, including Java and Kotlin, while most languages do not allow contravariant method argument types.

### Source excerpt

Most of the time, subtyping is intuitive. Object-oriented programmers are used to the concept of inheritance, where one class specializes another, and we're familiar with the idea of passing, say, a Dog object where a function expects an Animal. Once you start working with generics, though, there are some fascinating twists that flip our typical understanding of subtyping on its head. What is Contravariance? Contravariance describes a relationship between two sets of types where they subtype in opposite directions.

## Covariance

DevFeed: [Covariance](<https://devfeed.tech/articles/covariance-25011.md>)

Original publisher: [Read original article](<https://typealias.com/concepts/covariance/>)

Author: author@typealias.com (Dave Leeds)

Published: 2017-11-14T00:00:00Z

Content type: article

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [data type](<https://devfeed.tech/topics/data-type.md>), [generic programming](<https://devfeed.tech/topics/generic-programming.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>), [Inheritance](<https://devfeed.tech/topics/inheritance.md>), [subclass](<https://devfeed.tech/topics/subclass.md>), [superclass](<https://devfeed.tech/topics/superclass.md>), [class](<https://devfeed.tech/topics/class.md>)

Tags: [contravariance](<https://devfeed.tech/tags/contravariance.md>), [covariance](<https://devfeed.tech/tags/covariance.md>), [generic](<https://devfeed.tech/tags/generic.md>), [generics](<https://devfeed.tech/tags/generics.md>), [inheritance](<https://devfeed.tech/tags/inheritance.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [programming](<https://devfeed.tech/tags/programming.md>), [subtype](<https://devfeed.tech/tags/subtype.md>), [type-parameter](<https://devfeed.tech/tags/type-parameter.md>), [variance](<https://devfeed.tech/tags/variance.md>)

### AI overview

Covariance means two type relationships subtype in the same direction. In Kotlin, a read-only List is covariant: if B is a subtype of A, List<B> can be used where List<A> is expected. MutableList is not covariant, since allowing that substitution could make writes unsafe. Generic classes are invariant by default; marking a parameter `out` permits covariance but requires the class to only produce that type, not accept it as a function argument or setter value. The excerpt also notes that subclass overrides may use a more specific return type, though its example is cut off.

### Source excerpt

On the surface, subtypes seem straightforward. Most programmers who write object-oriented code are familiar with the concept of inheritance, and how you can pass off a subclass as if it were its superclass. But subtyping rules aren't always as intuitive when you start working with generics. What is Covariance? Covariance describes a relationship between two sets of types where they both subtype in the same direction. For example, for our first set of types, here are two classes, A and B, where B is a subtype of A:

## Liskov Substitution Principle

DevFeed: [Liskov Substitution Principle](<https://devfeed.tech/articles/liskov-substitution-principle-40710.md>)

Original publisher: [Read original article](<https://radek.io/posts/liskov-substitution-principle/>)

Published: 2011-08-09T00:00:00Z

Content type: tutorial

Language: en

Sources: [Radek Pazdera](<https://devfeed.tech/sources/radek-pazdera.md>)

Topics: [Software Engineering](<https://devfeed.tech/topics/software-engineering.md>), [software-architecture](<https://devfeed.tech/topics/software-architecture.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [subclass](<https://devfeed.tech/topics/subclass.md>), [subtype](<https://devfeed.tech/topics/subtype.md>)

Tags: [hierarchy](<https://devfeed.tech/tags/hierarchy.md>), [object-oriented](<https://devfeed.tech/tags/object-oriented.md>), [software-design](<https://devfeed.tech/tags/software-design.md>), [solid](<https://devfeed.tech/tags/solid.md>), [subclass](<https://devfeed.tech/tags/subclass.md>), [subtype](<https://devfeed.tech/tags/subtype.md>)

### AI overview

This article explains the Liskov Substitution Principle, the L in SOLID object-oriented design. It presents definitions from Barbara Liskov and Jeannette Wing, a formulation by Robert C. Martin, and a Square-Rectangle hierarchy example showing how subtype behavior can violate substitutability.

### Source excerpt

SOLID Object-Oriented Design

## Private, protected and public in Python

DevFeed: [Private, protected and public in Python](<https://devfeed.tech/articles/private-protected-and-public-in-python-40732.md>)

Original publisher: [Read original article](<https://radek.io/posts/private-protected-and-public-in-python/>)

Published: 2011-07-21T00:00:00Z

Content type: tutorial

Language: en

Sources: [Radek Pazdera](<https://devfeed.tech/sources/radek-pazdera.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [class](<https://devfeed.tech/topics/class.md>), [subclass](<https://devfeed.tech/topics/subclass.md>), [object](<https://devfeed.tech/topics/object.md>), [Pull Request](<https://devfeed.tech/topics/pull-request.md>)

Tags: [class](<https://devfeed.tech/tags/class.md>), [object](<https://devfeed.tech/tags/object.md>), [programming](<https://devfeed.tech/tags/programming.md>), [pull-request](<https://devfeed.tech/tags/pull-request.md>), [python](<https://devfeed.tech/tags/python.md>), [subclass](<https://devfeed.tech/tags/subclass.md>)

### AI overview

This tutorial explains how Python handles public, protected, and private members through defaults, naming conventions, and name mangling rather than strict access modifiers. It also discusses how these conventions apply to subclasses and code reviews.

### Source excerpt

How does encapsulation (not) work in Python.