RSSAmplifier

Baptiste Fontaine’s Blog · Sep 25, 2021

Typing Tuples in Python

0
Sign in to vote or save

This page did not load. You can still read it on the original site — the toolbar below keeps your place in the directory.

Python added support for type hints in 3.5. These are not typing as you may be used to in other languages since they have no effect on the compilation to bytecode nor at runtime, but rather hints for the (tools of the) developer. def print_int(n: int): print(n) print_int(1) print_int("foo") The code above doesn’t fail when you call print_int("foo") even though n is “typed” as an int . This is…

Read on bfontaine.net

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.