Skip to content

Commit 5a6ceec

Browse files
committed
Remove parts of RFC 69 deprecated in Amaranth 0.5.1.
This is done as a separate follow-up commit to implementing RFC 69 so that the base version can be cherry-picked into Amaranth 0.5.1 as-is.
1 parent 7851094 commit 5a6ceec

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

amaranth/lib/io.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import enum
22
import operator
3-
import warnings
43
from abc import ABCMeta, abstractmethod
54
from collections.abc import Iterable
65

@@ -58,12 +57,6 @@ class PortLike(metaclass=ABCMeta):
5857
:class:`amaranth.hdl.IOPort` is not an instance of :class:`amaranth.lib.io.PortLike`.
5958
"""
6059

61-
# TODO(amaranth-0.6): remove
62-
def __init_subclass__(cls):
63-
if cls.__add__ is PortLike.__add__:
64-
warnings.warn(f"{cls.__module__}.{cls.__qualname__} must override the `__add__` method",
65-
DeprecationWarning, stacklevel=2)
66-
6760
@property
6861
@abstractmethod
6962
def direction(self):
@@ -115,8 +108,7 @@ def __invert__(self):
115108
"""
116109
raise NotImplementedError # :nocov:
117110

118-
# TODO(amaranth-0.6): make abstract
119-
# @abstractmethod
111+
@abstractmethod
120112
def __add__(self, other):
121113
"""Concatenates two library I/O ports of the same type.
122114

tests/test_lib_io.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@ def test_and(self):
3030
Direction.Bidir & 3
3131

3232

33-
class PortLikeTestCase(FHDLTestCase):
34-
def test_warn___add__(self):
35-
with self.assertWarnsRegex(DeprecationWarning,
36-
r"WrongPortLike must override the `__add__` method$"):
37-
class WrongPortLike(PortLike):
38-
pass
39-
40-
4133
class SingleEndedPortTestCase(FHDLTestCase):
4234
def test_construct(self):
4335
io = IOPort(4)

0 commit comments

Comments
 (0)