Tag

isinstance

0 views collected around this technical thread.

Code Mala Tang
Code Mala Tang
Apr 6, 2025 · Fundamentals

Why Overusing isinstance() Makes Python Code Rigid – Better Practices

This article explains why relying heavily on Python's isinstance() for type checking leads to less flexible code, introduces the EAFP vs. LBYL philosophies, and shows when isinstance() is appropriate through clear examples and best‑practice guidelines.

Best PracticesEAFPduck typing
0 likes · 8 min read
Why Overusing isinstance() Makes Python Code Rigid – Better Practices
Test Development Learning Exchange
Test Development Learning Exchange
Feb 13, 2025 · Fundamentals

Understanding Python's isinstance() Function: Basics, Inheritance, and Best Practices

This article introduces Python's isinstance() function, explains its syntax, demonstrates basic and advanced usage including inheritance, abstract base classes, and best practices, and compares it with type() while highlighting type hints for more maintainable code.

Abstract Base ClassesBest Practicesinheritance
0 likes · 6 min read
Understanding Python's isinstance() Function: Basics, Inheritance, and Best Practices
Test Development Learning Exchange
Test Development Learning Exchange
Jan 2, 2025 · Fundamentals

Understanding Python’s isinstance() and type() Functions: Syntax, Usage, and Differences

This article explains the purpose, syntax, parameters, return values, and practical examples of Python’s isinstance() and type() functions, compares their behavior regarding inheritance and polymorphism, and provides advanced usage scenarios for accurate type checking in code.

inheritanceisinstanceprogramming fundamentals
0 likes · 10 min read
Understanding Python’s isinstance() and type() Functions: Syntax, Usage, and Differences
Test Development Learning Exchange
Test Development Learning Exchange
Aug 27, 2018 · Fundamentals

Python type() Function and Dynamic Class Creation

This article explains the Python type() function, its syntax, usage, and differences with isinstance(), including how to dynamically create classes using type().

Dynamic Class Creationclass creationfundamentals
0 likes · 4 min read
Python type() Function and Dynamic Class Creation