diff --git a/my/coding/codeforces.py b/my/coding/codeforces.py index 138cc73..4a5007d 100644 --- a/my/coding/codeforces.py +++ b/my/coding/codeforces.py @@ -9,9 +9,9 @@ from typing import Dict, Iterator, Any from ..common import cproperty, get_files from ..error import Res, unwrap +from ..core.konsume import zoom, ignore, wrap from kython import fget -from kython.konsume import zoom, ignore, wrap # TODO remove from kython.kdatetime import as_utc diff --git a/my/coding/topcoder.py b/my/coding/topcoder.py index c370b5d..419cbe1 100644 --- a/my/coding/topcoder.py +++ b/my/coding/topcoder.py @@ -12,7 +12,7 @@ from ..error import Res, unwrap # TODO get rid of fget? from kython import fget -from kython.konsume import zoom, wrap, ignore +from ..core.konsume import zoom, wrap, ignore # TODO json type?? diff --git a/my/kython/konsume.py b/my/core/konsume.py similarity index 94% rename from my/kython/konsume.py rename to my/core/konsume.py index bdf9d4b..76d629f 100644 --- a/my/kython/konsume.py +++ b/my/core/konsume.py @@ -1,3 +1,10 @@ +''' +Some experimental JSON parsing, basically to ensure that all data is consumed. +This can potentially allow both for safer defensive parsing, and let you know if the data started returning more data + +TODO perhaps need to get some inspiration from linear logic to decide on a nice API... +''' + from collections import OrderedDict from typing import Any, List diff --git a/my/reading/polar.py b/my/reading/polar.py index cec7a46..8547bee 100755 --- a/my/reading/polar.py +++ b/my/reading/polar.py @@ -45,7 +45,7 @@ import pytz from ..core import LazyLogger, Json from ..core.common import isoparse from ..error import Res, echain, sort_res_by -from ..kython.konsume import wrap, zoom, ignore, Zoomable, Wdict +from ..core.konsume import wrap, zoom, ignore, Zoomable, Wdict logger = LazyLogger(__name__)