Tagged articles
19 articles
Page 1 of 1
Code Mala Tang
Code Mala Tang
Jan 21, 2025 · Fundamentals

Master Python Classes: Inheritance, Composition, and Advanced OOP Techniques

This guide explores Python class fundamentals, covering inheritance versus composition, the use of super(), distinctions among instance, class, and static methods, dataclasses, the __dict__ attribute, name mangling, @property, dynamic class creation with type(), and __slots__ for attribute control.

InheritanceOOPProperty
0 likes · 9 min read
Master Python Classes: Inheritance, Composition, and Advanced OOP Techniques
Test Development Learning Exchange
Test Development Learning Exchange
Aug 2, 2023 · Fundamentals

10 Practical Python Metaprogramming Scenarios Using __getattr__, __setattr__, and Descriptors

This article presents ten useful Python metaprogramming examples that demonstrate dynamic attribute access, setting, descriptor‑based validation, runtime attribute creation and deletion, computed properties, dynamic class and method generation, and metaclass techniques for flexible program behavior.

Propertycode-examplesdynamic attributes
0 likes · 6 min read
10 Practical Python Metaprogramming Scenarios Using __getattr__, __setattr__, and Descriptors
MaGe Linux Operations
MaGe Linux Operations
Dec 14, 2022 · Fundamentals

Master Python’s @property: Turn Methods into Read‑Only Attributes

Learn how Python’s @property decorator transforms methods into read‑only attributes, enabling attribute‑style access, preventing unintended modifications, and illustrating proper usage with code examples that show correct and incorrect calls, common pitfalls, and best practices for encapsulating data.

DecoratorEncapsulationProperty
0 likes · 4 min read
Master Python’s @property: Turn Methods into Read‑Only Attributes
Tencent Cloud Developer
Tencent Cloud Developer
Feb 24, 2022 · Fundamentals

Understanding Property Registration and Runtime Access in a C++ Reflection Framework

The article dissects the Ponder C++ reflection library’s Property subsystem, explaining how registration via ClassBuilder creates property entries, how traits and ValueBinders map members to abstract Property objects, and how runtime Get/Set calls traverse templated binders to provide type‑safe, high‑performance access.

C++PropertyRuntime
0 likes · 16 min read
Understanding Property Registration and Runtime Access in a C++ Reflection Framework
IT Services Circle
IT Services Circle
Feb 6, 2022 · Fundamentals

Using Python Descriptors to Enforce the Single Responsibility Principle

This article explains what Python descriptors are, why they help follow the Single Responsibility Principle, and demonstrates how to replace repetitive property setters with reusable descriptor classes such as a fuel‑capacity validator and a generic range‑checking descriptor.

Propertydescriptorsprogramming
0 likes · 4 min read
Using Python Descriptors to Enforce the Single Responsibility Principle
MaGe Linux Operations
MaGe Linux Operations
Jul 30, 2021 · Fundamentals

Unlock Python’s Hidden Attribute System: __dict__, property, and __getattr__ Explained

This article explains how Python stores object attributes in layered __dict__ structures, distinguishes class and instance attributes, demonstrates attribute lookup, shows how to modify attributes directly or via property, and introduces dynamic attribute creation using __getattr__ and related special methods.

AttributesObject-OrientedProperty
0 likes · 8 min read
Unlock Python’s Hidden Attribute System: __dict__, property, and __getattr__ Explained
Python Programming Learning Circle
Python Programming Learning Circle
Jul 21, 2021 · Fundamentals

Understanding Python's __dict__ System, Properties, and Dynamic Attribute Generation

This article explains Python's __dict__ attribute storage, class and instance attributes, demonstrates how to inspect and modify them, introduces properties using the built‑in property() function, and shows dynamic attribute generation with __getattr__, providing clear code examples and explanations.

AttributesObject-OrientedProperty
0 likes · 9 min read
Understanding Python's __dict__ System, Properties, and Dynamic Attribute Generation
Byte Quality Assurance Team
Byte Quality Assurance Team
Jun 23, 2021 · Fundamentals

Understanding Python Properties and Descriptors

This article explains Python's property decorator and descriptor protocol, showing how to turn methods into managed attributes, perform validation, compute derived values, and illustrates their implementation with clear code examples including a Student class, a custom descriptor, and a classmethod reimplementation.

Code ExampleDescriptorOOP
0 likes · 8 min read
Understanding Python Properties and Descriptors
ByteFE
ByteFE
May 11, 2021 · Frontend Development

Leveraging CSS @property (Houdini) for Advanced Animations and Custom Property Control

This article introduces the CSS @property at‑rule, explains how it extends the Houdini API to define typed custom properties with defaults and inheritance, and demonstrates a series of practical animations—including gradient transitions, conic‑gradient pie charts, length‑based underline effects, and a full‑screen saver—by rewriting traditional CSS with @property definitions and showcasing the required code snippets.

CSSHoudiniProperty
0 likes · 13 min read
Leveraging CSS @property (Houdini) for Advanced Animations and Custom Property Control
Python Programming Learning Circle
Python Programming Learning Circle
Apr 22, 2021 · Fundamentals

Advanced Class Methods and Special Member Functions in Python

This article explains Python's advanced class features—including static methods, class methods, property decorators, special dunder methods, reflection utilities, dynamic attribute manipulation, metaclass creation, and exception handling—illustrated with clear code examples and practical usage tips.

Exception HandlingPropertyReflection
0 likes · 14 min read
Advanced Class Methods and Special Member Functions in Python
Python Crawling & Data Mining
Python Crawling & Data Mining
Apr 11, 2021 · Fundamentals

Unlock Python’s @property: Turn Methods into Seamless Attributes

This article explains how Python’s @property decorator transforms class methods into attribute-like accessors, covering basic usage, setter/getter patterns, error handling, and practical examples such as score validation and temperature conversion, helping developers write cleaner, more encapsulated code.

DecoratorPropertyPython
0 likes · 8 min read
Unlock Python’s @property: Turn Methods into Seamless Attributes
ByteFE
ByteFE
Mar 14, 2021 · Frontend Development

Exploring @property and Its Animating Powers

This article explains how the CSS @property rule lets developers define the syntax, initial value, and inheritance behavior of custom properties, enabling type‑checked animations and transitions that were previously impossible with plain string‑based CSS variables.

CSSCustom PropertiesProperty
0 likes · 25 min read
Exploring @property and Its Animating Powers
ByteFE
ByteFE
Mar 11, 2021 · Frontend Development

Exploring CSS @property: Type Checking, Animations, and Creative Uses

This article introduces the CSS @property rule, explains how it enables type‑checking for custom properties, and demonstrates a variety of animation techniques—including color cycles, gradients, transforms, and numeric counters—to showcase the powerful new possibilities for modern front‑end development.

CSSPropertyanimation
0 likes · 11 min read
Exploring CSS @property: Type Checking, Animations, and Creative Uses