Top "Type-hinting" questions

Type hinting binds function arguments to specific objects or strongly types them.

PhpStorm type-hinting for factories?

I have code more or less like this: class Foo { public static function factory($str) { $class = "Foo_" . $str; return new $…

factory phpstorm type-hinting
Does Python type hint (annotations) cause some run-time effects?

Can Python function annotations and type hints (PEP 3107 and PEP 484) cause some run-time effects? Could it made the code faster? …

python annotations type-hinting
Python >=3.5: Checking type annotation at runtime

Does the typing module (or any other module) exhibit an API to typecheck a variable at runtime, similar to isinstance() …

python python-3.x type-hinting mypy
Returning NULL with return type declarations

I was refactoring a codebase for use with PHP7, particularly implementing scalar type hints and return type hints, when I …

php php-7 type-hinting php-7.1
How do I correctly add type-hints to Mixin classes?

Consider the following example. The example is contrived but illustrates the point in a runnable example: class MultiplicatorMixin: def multiply(…

python oop type-hinting mypy python-typing