Skip to content

Commit

Permalink
Merge pull request #386 from orsinium-forks/lazy-annotations
Browse files Browse the repository at this point in the history
Make all type annotations lazy
  • Loading branch information
wallyqs committed Nov 20, 2022
2 parents 0443f8a + 0e37f5d commit 2b31c90
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nats/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from __future__ import annotations

from typing import List, Union

from .aio.client import Client as NATS
Expand Down
2 changes: 2 additions & 0 deletions nats/aio/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# limitations under the License.
#

from __future__ import annotations

import asyncio
import base64
import ipaddress
Expand Down
2 changes: 2 additions & 0 deletions nats/aio/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# limitations under the License.
#

from __future__ import annotations

import nats.errors


Expand Down
2 changes: 2 additions & 0 deletions nats/aio/msg.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from __future__ import annotations

import datetime
import json
from dataclasses import dataclass
Expand Down
2 changes: 2 additions & 0 deletions nats/aio/subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# limitations under the License.
#

from __future__ import annotations

import asyncio
from typing import (
TYPE_CHECKING,
Expand Down
2 changes: 2 additions & 0 deletions nats/aio/transport.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import abc
import asyncio
import ssl
Expand Down
2 changes: 2 additions & 0 deletions nats/js/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# limitations under the License.
#

from __future__ import annotations

from . import api
from .client import JetStreamContext
from .manager import JetStreamManager
Expand Down
2 changes: 2 additions & 0 deletions nats/js/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# limitations under the License.
#

from __future__ import annotations

from dataclasses import dataclass, fields, replace
from enum import Enum
from typing import Any, Dict, List, Optional, Type, TypeVar
Expand Down
2 changes: 2 additions & 0 deletions nats/js/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# limitations under the License.
#

from __future__ import annotations

import asyncio
import json
import time
Expand Down
2 changes: 2 additions & 0 deletions nats/js/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# limitations under the License.
#

from __future__ import annotations

from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, Dict, NoReturn, Optional

Expand Down
2 changes: 2 additions & 0 deletions nats/js/kv.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# limitations under the License.
#

from __future__ import annotations

import asyncio
import datetime
from dataclasses import dataclass
Expand Down
2 changes: 2 additions & 0 deletions nats/js/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# limitations under the License.
#

from __future__ import annotations

import base64
import json
from email.parser import BytesParser
Expand Down
2 changes: 2 additions & 0 deletions nats/nuid.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# limitations under the License.
#

from __future__ import annotations

from random import Random
from secrets import randbelow, token_bytes
from sys import maxsize as MaxInt
Expand Down
2 changes: 2 additions & 0 deletions nats/protocol/command.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from typing import Callable

PUB_OP = 'PUB'
Expand Down
2 changes: 2 additions & 0 deletions nats/protocol/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
NATS network protocol parser.
"""

from __future__ import annotations

import json
import re
from typing import Any, Dict
Expand Down

0 comments on commit 2b31c90

Please sign in to comment.