Skip to content

Commit

Permalink
Import 'Literal' from serde.compat
Browse files Browse the repository at this point in the history
  • Loading branch information
kngwyu committed Jul 24, 2022
1 parent eddf250 commit a7450c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
7 changes: 1 addition & 6 deletions tests/test_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@
from datetime import datetime
from typing import Dict, Generic, List, NewType, Optional, Set, Tuple, TypeVar, Union

if sys.version_info[:2] == (3, 7):
from typing_extensions import Literal
else:
from typing import Literal


import serde
from serde.compat import (
Literal,
is_dict,
is_generic,
is_list,
Expand Down
3 changes: 2 additions & 1 deletion tests/test_union.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
import sys
from dataclasses import dataclass
from ipaddress import IPv4Address
from typing import Dict, Generic, List, Literal, Optional, Tuple, TypeVar, Union
from typing import Dict, Generic, List, Optional, Tuple, TypeVar, Union
from uuid import UUID

import pytest

from serde import SerdeError, from_dict, from_tuple
from serde import init as serde_init
from serde import logger, serde, to_dict, to_tuple
from serde.compat import Literal
from serde.json import from_json, to_json

logging.basicConfig(level=logging.WARNING)
Expand Down

0 comments on commit a7450c1

Please sign in to comment.