Skip to content

Re-add slashed into signatures #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 13, 2024
Merged
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
6 changes: 2 additions & 4 deletions circuitpython_typing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,14 @@ class ByteStream(Protocol):
* `usb_cdc.Serial`
"""

# Should be `, /)`, but not available in Python 3.7.
def read(self, count: Optional[int] = None) -> Optional[bytes]:
def read(self, count: Optional[int] = None, /) -> Optional[bytes]:
"""Read ``count`` bytes from the stream.
If ``count`` bytes are not immediately available,
or if the parameter is not specified in the call,
the outcome is implementation-dependent.
"""

# Should be `, /)`, but not available in Python 3.7.
def write(self, buf: ReadableBuffer) -> Optional[int]:
def write(self, buf: ReadableBuffer, /) -> Optional[int]:
"""Write the bytes in ``buf`` to the stream."""


Expand Down
6 changes: 1 addition & 5 deletions circuitpython_typing/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ def value(self) -> float:
on the specifics of the class.
"""

# TODO: this should be `value(self, input_value: float, /)` but can't
# because currently mpy files are built and the `/` param isn't supported
# in micro-python.
# https://github.com/adafruit/Adafruit_CircuitPython_Typing/issues/36
# pylint: disable=no-self-use,unused-argument
@value.setter
def value(self, input_value: float):
def value(self, input_value: float, /):
...