Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs1-24fa
project03
Commits
15279f68
Commit
15279f68
authored
6 months ago
by
Antonio Caceres
Browse files
Options
Download
Email Patches
Plain Diff
Remove abc from the abstract base classes.
parent
a9cbb517
master
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/abstract.py
+8
-11
src/abstract.py
with
8 additions
and
11 deletions
+8
-11
src/abstract.py
View file @
15279f68
from
abc
import
ABC
,
abstractmethod
"""Collection of abstract classes for type hinting in the rest of the project."""
# We aren't using the abc module because it isn't available on circuitpy.
class
ProximitySensor
(
ABC
):
class
ProximitySensor
:
"""Abstract proximity sensor."""
@
property
@
abstractmethod
def
proximity
(
self
)
->
int
:
...
return
-
1
class
LEDController
(
ABC
)
:
class
LEDController
:
"""Abstract LED controller."""
@
abstractmethod
def
fill
(
self
,
color
:
tuple
[
int
,
int
,
int
])
->
None
:
...
pass
class
TouchSensor
(
ABC
)
:
class
TouchSensor
:
"""Abstract touch sensor."""
@
property
@
abstractmethod
def
value
(
self
)
->
bool
:
...
return
False
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help