mirror of https://github.com/jab/bidict.git
docs tweaks
This commit is contained in:
parent
c6831d888b
commit
c990197122
|
@ -137,10 +137,10 @@ Subclassing :func:`~collections.namedtuple` classes
|
|||
|
||||
To get the performance benefits, intrinsic sortability, etc.
|
||||
of :func:`~collections.namedtuple`
|
||||
but customize behavior, state, API, etc.,
|
||||
you can subclass a :func:`~collections.namedtuple`-created class.
|
||||
Just make sure to include ``__slots__ = ()``
|
||||
or you'll lose some of the performance benefits.
|
||||
while customizing behavior, state, API, etc.,
|
||||
you can subclass a :func:`~collections.namedtuple` class.
|
||||
Just make sure to include ``__slots__ = ()``,
|
||||
or you'll lose a lot of the performance benefits.
|
||||
|
||||
``_marker.py`` contains a small example.
|
||||
Here's a larger one:
|
||||
|
|
|
@ -24,12 +24,12 @@ by adding the
|
|||
:obj:`~abc.abstractproperty`. [#fn-subclasshook]_
|
||||
|
||||
.. [#fn-subclasshook]
|
||||
(In fact, any :class:`collections.abc.Mapping`
|
||||
In fact, any :class:`collections.abc.Mapping`
|
||||
that provides an ``inv`` attribute
|
||||
will be considered a virtual subclass of
|
||||
:class:`bidict.BidirectionalMapping`
|
||||
:meth:`automatically <bidict.BidirectionalMapping.__subclasshook__>`,
|
||||
enabling interoperability with external implementations.)
|
||||
enabling interoperability with external implementations.
|
||||
|
||||
As you may have noticed,
|
||||
:class:`bidict.bidict` is also
|
||||
|
|
Loading…
Reference in New Issue