Skip to content

Commit 3d9f5f1

Browse files
authored
Fixes compatibility with python3.8 (#47)
* fix compat with python 3.8 * version bump
1 parent ca5446b commit 3d9f5f1

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ def run_tests(self):
2424
sys.exit(errno)
2525

2626

27-
VERSION = '0.1.0'
27+
VERSION = '0.1.1'
2828

2929
setup(
3030
name="timefhuman",
3131
version=VERSION,
3232
author="Alvin Wan",
3333
author_email='hi@alvinwan.com',
34-
description=("Convert natural language date-like string to Python objects"),
34+
description=("Extract datetimes, datetime ranges, and datetime lists from natural language text"),
3535
long_description=open('README.md', 'r', encoding='utf-8').read(),
3636
long_description_content_type='text/markdown',
3737
license="Apache 2.0",

timefhuman/renderers.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ class tfhCollection(tfhDatelike):
4747
def __init__(self, items):
4848
self.items = items
4949

50-
@staticmethod
5150
def getter(key):
5251
def get(self):
5352
for item in self.items:
@@ -56,7 +55,6 @@ def get(self):
5655
return None
5756
return get
5857

59-
@staticmethod
6058
def setter(key):
6159
def set(self, value):
6260
for item in self.items:

timefhuman/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from lark.lexer import Token
66
from dataclasses import dataclass
77
from enum import Enum
8+
from typing import List
89

910

1011
MONTHS = [
@@ -72,14 +73,14 @@ def node_to_dict(node: Tree) -> dict:
7273
raise ValueError(f"Unknown node type: {type(node)} ({node})")
7374

7475

75-
def nodes_to_dict(nodes: list[Tree]) -> dict:
76+
def nodes_to_dict(nodes: List[Tree]) -> dict:
7677
result = {}
7778
for node in nodes:
7879
result.update(node_to_dict(node))
7980
return result
8081

8182

82-
def nodes_to_multidict(nodes: list[Tree]) -> dict:
83+
def nodes_to_multidict(nodes: List[Tree]) -> dict:
8384
result = {}
8485
for node in nodes:
8586
for key, value in node_to_dict(node).items():

0 commit comments

Comments
 (0)