Vladimir

4%
Flag icon
The expressions str(name) and float(lat) look like constructor calls, which we’d use to convert name and lat to str and float. But in the context of a pattern, that syntax performs a runtime type check: the preceding pattern will match a four-item sequence in which item 0 must be a str, and item 3 must be a pair of floats.
Fluent Python: Clear, Concise, and Effective Programming
Rate this book
Clear rating
Open Preview