Modernize code to Python 3.6+ and some cleanup
This commit is contained in:
@@ -16,7 +16,7 @@ class Coordinate:
|
||||
|
||||
lat: float
|
||||
long: float
|
||||
|
||||
|
||||
def __str__(self):
|
||||
ns = 'N' if self.lat >= 0 else 'S'
|
||||
we = 'E' if self.long >= 0 else 'W'
|
||||
|
||||
@@ -30,7 +30,7 @@ To fix, ``leo2`` must be created with an explicit ``handle``::
|
||||
|
||||
# tag::HACKERCLUB[]
|
||||
from dataclasses import dataclass
|
||||
from club import ClubMember
|
||||
from club import ClubMember
|
||||
|
||||
@dataclass
|
||||
class HackerClubMember(ClubMember): # <1>
|
||||
|
||||
@@ -31,7 +31,7 @@ To fix, ``leo2`` must be created with an explicit ``handle``::
|
||||
# tag::HACKERCLUB[]
|
||||
from dataclasses import dataclass
|
||||
from typing import ClassVar, Set
|
||||
from club import ClubMember
|
||||
from club import ClubMember
|
||||
|
||||
@dataclass
|
||||
class HackerClubMember(ClubMember):
|
||||
|
||||
@@ -14,7 +14,7 @@ A complete resource record:
|
||||
>>> description = 'Improving the design of existing code'
|
||||
>>> book = Resource('978-0-13-475759-9', 'Refactoring, 2nd Edition',
|
||||
... ['Martin Fowler', 'Kent Beck'], date(2018, 11, 19),
|
||||
... ResourceType.BOOK, description, 'EN',
|
||||
... ResourceType.BOOK, description, 'EN',
|
||||
... ['computer programming', 'OOP'])
|
||||
>>> book # doctest: +NORMALIZE_WHITESPACE
|
||||
Resource(identifier='978-0-13-475759-9', title='Refactoring, 2nd Edition',
|
||||
|
||||
@@ -21,7 +21,7 @@ A complete resource record:
|
||||
>>> description = 'Improving the design of existing code'
|
||||
>>> book = Resource('978-0-13-475759-9', 'Refactoring, 2nd Edition',
|
||||
... ['Martin Fowler', 'Kent Beck'], date(2018, 11, 19),
|
||||
... ResourceType.BOOK, description, 'EN',
|
||||
... ResourceType.BOOK, description, 'EN',
|
||||
... ['computer programming', 'OOP'])
|
||||
|
||||
# tag::DOCTEST[]
|
||||
|
||||
Reference in New Issue
Block a user