Skip to content

Commit 9e9e8b7

Browse files
authored
Merge pull request #8 from tcfranks/main
correct Missing Type Annotations #6
2 parents 74f9928 + f890c88 commit 9e9e8b7

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

adafruit_fakerequests.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,28 @@
2323

2424
import json
2525

26+
try:
27+
from typing import Any
28+
except ImportError:
29+
pass
30+
2631
__version__ = "0.0.0+auto.0"
2732
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FakeRequests.git"
2833

2934

3035
class Fake_Requests:
3136
"""For faking 'requests' using a local file instead of the network."""
3237

33-
def __init__(self, filename):
38+
def __init__(self, filename: str) -> None:
3439
self._filename = filename
3540

36-
def json(self):
41+
def json(self) -> Any:
3742
"""json parsed version for local requests."""
3843
with open(self._filename, "r") as file:
3944
return json.load(file)
4045

4146
@property
42-
def text(self):
47+
def text(self) -> str:
4348
"""raw text version for local requests."""
4449
with open(self._filename, "r") as file:
4550
return file.read()

0 commit comments

Comments
 (0)