Python typing

From wikinotes
Revision as of 23:25, 12 February 2021 by Will (talk | contribs) (→‎Example)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Adds type annotations to python.


Example

from typing import Dict, List, Tuple, Bool

class Project:
    def add_user(user: User) -> Bool
        pass

    def set_active(status: Bool=False) -> Bool:
        pass

    def update_metadata(data: List[Dict]) -> List[Dict]:
        pass