sync with O'Reilly Atlas

This commit is contained in:
Luciano Ramalho
2021-07-07 23:45:54 -03:00
parent f0f160844d
commit 23e78eeb82
64 changed files with 2087 additions and 124 deletions

View File

@@ -0,0 +1,20 @@
"""
``Coordinate``: a simple ``NamedTuple`` subclass
This version has a field with a default value::
>>> moscow = Coordinate(55.756, 37.617)
>>> moscow
Coordinate(lat=55.756, lon=37.617, reference='WGS84')
"""
# tag::COORDINATE[]
from typing import NamedTuple
class Coordinate(NamedTuple):
lat: float # <1>
lon: float
reference: str = 'WGS84' # <2>
# end::COORDINATE[]