Top "Type-hinting" questions

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

Pythonic type hints with pandas?

Let's take a simple function that takes a str and returns a dataframe: import pandas as pd def csv_to_…

python pandas type-hinting typing
PHP: bool vs boolean type hinting

I've been trying to use type hinting more in PHP. Today I was writing a function that takes a boolean …

php boolean default-value type-hinting
Python 3 type hinting for None?

def foo( hello: str='world', bar: str=None, another_string_or_None: str|????=None): pass I'm trying to set a …

python python-3.x nonetype type-hinting
Type hint for a file or file-like object?

Is there any correct type hint to use for a file or file-like object in Python? For example, how would …

python type-hinting
Type hinting / annotation (PEP 484) for numpy.ndarray

Has anyone implemented type hinting for the specific numpy.ndarray class? Right now, I'm using typing.Any, but it would …

python numpy python-3.5 type-hinting
Type hinting - specify an array of objects

How can I specify the argument type as an array? Say I have a class named 'Foo': class Foo {} and …

php arrays type-hinting
Python type hinting without cyclic imports

I'm trying to split my huge class into two; well, basically into the "main" class and a mixin with additional …

python pycharm python-3.4 python-3.5 type-hinting
Type hinting for any object

I've been working on code that's intended to be used with objects, without really caring what the kind of object …

php type-hinting
Passing default list argument to dataclasses

I would like to pass default argument in my class, but somehow I am having problem: from dataclasses import dataclass, …

python python-3.x oop type-hinting
Using List/Tuple/etc. from typing vs directly referring type as list/tuple/etc

What's the difference of using List, Tuple, etc. from typing module: from typing import Tuple def f(points: Tuple): return …

python python-3.5 typing type-hinting