Skip to content

Commit

Permalink
Fixes compatibility with python3.8 (#47)
Browse files Browse the repository at this point in the history
* fix compat with python 3.8

* version bump
  • Loading branch information
alvinwan authored Jan 20, 2025
1 parent ca5446b commit 3d9f5f1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ def run_tests(self):
sys.exit(errno)


VERSION = '0.1.0'
VERSION = '0.1.1'

setup(
name="timefhuman",
version=VERSION,
author="Alvin Wan",
author_email='hi@alvinwan.com',
description=("Convert natural language date-like string to Python objects"),
description=("Extract datetimes, datetime ranges, and datetime lists from natural language text"),
long_description=open('README.md', 'r', encoding='utf-8').read(),
long_description_content_type='text/markdown',
license="Apache 2.0",
Expand Down
2 changes: 0 additions & 2 deletions timefhuman/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class tfhCollection(tfhDatelike):
def __init__(self, items):
self.items = items

@staticmethod
def getter(key):
def get(self):
for item in self.items:
Expand All @@ -56,7 +55,6 @@ def get(self):
return None
return get

@staticmethod
def setter(key):
def set(self, value):
for item in self.items:
Expand Down
5 changes: 3 additions & 2 deletions timefhuman/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from lark.lexer import Token
from dataclasses import dataclass
from enum import Enum
from typing import List


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


def nodes_to_dict(nodes: list[Tree]) -> dict:
def nodes_to_dict(nodes: List[Tree]) -> dict:
result = {}
for node in nodes:
result.update(node_to_dict(node))
return result


def nodes_to_multidict(nodes: list[Tree]) -> dict:
def nodes_to_multidict(nodes: List[Tree]) -> dict:
result = {}
for node in nodes:
for key, value in node_to_dict(node).items():
Expand Down

0 comments on commit 3d9f5f1

Please sign in to comment.