Skip to content

Commit

Permalink
fixing types to be compatible for python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
seperman committed Dec 16, 2024
1 parent 737bb5a commit d2d3806
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions deepdiff/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
from copy import deepcopy, copy
from functools import partial
from collections.abc import Mapping
from typing import Callable
from typing import Callable, Optional, Union
from deepdiff.helper import (
strings,
get_type,
Expand Down Expand Up @@ -180,7 +180,7 @@ def from_json_pickle(cls, value):
else:
logger.error('jsonpickle library needs to be installed in order to run from_json_pickle') # pragma: no cover. Json pickle is getting deprecated.

def to_json(self, default_mapping: dict | None=None, force_use_builtin_json=False, **kwargs):
def to_json(self, default_mapping: Optional[dict]=None, force_use_builtin_json=False, **kwargs):
"""
Dump json of the text view.
**Parameters**
Expand Down Expand Up @@ -307,7 +307,7 @@ def _to_delta_dict(self, directed=True, report_repetition_required=True, always_

return deepcopy(dict(result))

def pretty(self, prefix: str | Callable=None):
def pretty(self, prefix: Optional[Union[str, Callable]]=None):
"""
The pretty human readable string output for the diff object
regardless of what view was used to generate the diff.
Expand Down

0 comments on commit d2d3806

Please sign in to comment.