Skip to content

Commit c5f98d6

Browse files
rwb27bprobert97
andauthored
Apply suggestions from code review
Co-authored-by: Beth <167304066+bprobert97@users.noreply.github.com>
1 parent 77f154c commit c5f98d6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/labthings_fastapi/base_descriptor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class DescriptorNotAddedToClassError(RuntimeError):
2828
"""Descriptor has not yet been added to a class.
2929
3030
This error is raised if certain properties of descriptors are accessed
31-
before ``__set_name__`` has been called on the descriptor. ``__set_name``
31+
before ``__set_name__`` has been called on the descriptor. ``__set_name__``
3232
is part of the descriptor protocol, and is called when a class is defined
3333
to notify the descriptor of its name and owning class.
3434
@@ -122,7 +122,7 @@ def __set_name__(self, owner: type[Thing], name: str) -> None:
122122
if name in attr_docs:
123123
self.__doc__ = attr_docs[name]
124124

125-
def assert_set_name_called(self):
125+
def assert_set_name_called(self) -> None:
126126
"""Raise an exception if ``__set_name__`` has not yet been called.
127127
128128
:raises DescriptorNotAddedToClassError: if ``__set_name__`` has not yet

src/labthings_fastapi/thing_property.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Counter(lt.Thing):
1515
"A counter that knows what's remaining."
1616
1717
count: int = lt.property(default=0, readonly=True)
18-
"The number of times we've increnented the counter."
18+
"The number of times we've incremented the counter."
1919
2020
target: int = lt.property(default=10)
2121
"The number of times to increment before we stop."
@@ -184,7 +184,8 @@ def default_factory_from_arguments(
184184
"""
185185
if default is ... and default_factory is None:
186186
# If the default is an ellipsis, we have no default value.
187-
# This is not allowed for DataProperty, so we raise an error.
187+
# Not having a default_factory alongside this
188+
# is not allowed for DataProperty, so we raise an error.
188189
raise MissingDefaultError()
189190
if default is not ... and default_factory is not None:
190191
# If both default and default_factory are set, we raise an error.

0 commit comments

Comments
 (0)