DORSETRIGS
Home

duck-typing (4 post)


posts by category not found!

Can EAFP and mypy coexist?

Can EAFP and Mypy Coexist A Guide to Error Handling and Type Checking The world of Python development often involves a delicate dance between speed and safety E

2 min read 06-10-2024 43
Can EAFP and mypy coexist?
Can EAFP and mypy coexist?

Asserting a variable has certain properties if it passes certain tests

Asserting Variable Properties with Python Type Hints A Guide to Enforcing Code Integrity In the world of Python programming type hints play a crucial role in en

2 min read 04-09-2024 41
Asserting a variable has certain properties if it passes certain tests
Asserting a variable has certain properties if it passes certain tests

How to indicate to mypy an object has certain attributes?

Mypy Magic Type Hints for Dynamic Attributes Mypy is a powerful tool for static type checking in Python ensuring code correctness before runtime However handlin

2 min read 04-09-2024 44
How to indicate to mypy an object has certain attributes?
How to indicate to mypy an object has certain attributes?

How to annotate a type that is a combination of multiple duck-types?

Combining Duck Types for Type Annotations in Python In Python type annotations help us write more robust and readable code Sometimes we need to specify a parame

2 min read 04-09-2024 42
How to annotate a type that is a combination of multiple duck-types?
How to annotate a type that is a combination of multiple duck-types?