Skip to content
This repository was archived by the owner on May 4, 2021. It is now read-only.
This repository was archived by the owner on May 4, 2021. It is now read-only.

Use typing module #18

@herczy

Description

@herczy

In Python3.5+, the way of hinting at types is done by using the typing module (see https://docs.python.org/3.5/library/typing.html). This module is also available through pip on older Python versions (I checked it with 3.4 and 2.7), so there we'd only need an extra dependency.

Using this to extend the type checker we could implement i.e. type templates/generics:

```
T = typing.TypeVar('T')

def append(l: typing.List[T], i: T):
    l.append(i)
```

It would also remove the need to constantly use collections for specifying collection-like type hints and also make us more PEP484 compliant. (see issue #15)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions