Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion json_stream_rs_tokenizer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"ExtensionException",
"ExtensionUnavailable",
"RequestedFeatureUnavailable",
"JsonStringReader",
]


Expand All @@ -20,6 +21,7 @@ class TokenType:
from .json_stream_rs_tokenizer import (
RustTokenizer as _RustTokenizer,
supports_bigint as _supports_bigint,
JsonStringReader,
)

# included only for backwards-compatibility - to the outside world, bigint
Expand Down Expand Up @@ -90,7 +92,7 @@ def rust_tokenizer_or_raise(requires_bigint=True, **kwargs):
ExtensionUnavailable: If the Rust extension is not available.
RequestedFeatureUnavailable: If a requested feature is not available.
"""
supported_kwargs = {"buffering"}
supported_kwargs = {"buffering", "strings_as_files"}
unsupported = kwargs.keys() - supported_kwargs
if unsupported:
raise RequestedFeatureUnavailable(
Expand Down
2 changes: 2 additions & 0 deletions src/int.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ pub enum ParseIntError {
use num_bigint::BigInt;

#[cfg(not(any(Py_LIMITED_API, PyPy)))]
#[derive(Clone)]
pub enum AppropriateInt {
Normal(i64),
Big(BigInt),
}

#[cfg(all(any(Py_LIMITED_API, PyPy)))]
#[derive(Clone)]
pub enum AppropriateInt {
Normal(i64),
Big(String), // to be converted into int on the Python side
Expand Down
Loading