Skip to content

Commit ab7464f

Browse files
Replace List -> list
1 parent 0f15ae1 commit ab7464f

51 files changed

Lines changed: 425 additions & 564 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/source/data-structures/elements/matrix/matrix.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ The Matrix class
201201
Instances of this class implement matrices over the semirings listed
202202
above in :any:`MatrixKind`.
203203

204-
.. py:method:: __init__(self: Matrix, kind: MatrixKind, rows: List[List[int | POSITIVE_INFINITY | NEGATIVE_INFINITY]]) -> None
204+
.. py:method:: __init__(self: Matrix, kind: MatrixKind, rows: list[list[int | POSITIVE_INFINITY | NEGATIVE_INFINITY]]) -> None
205205
:noindex:
206206

207207
Construct a matrix from rows.
@@ -210,7 +210,7 @@ The Matrix class
210210
:type kind: MatrixKind
211211

212212
:param rows: the rows of the matrix.
213-
:type rows: List[List[int | POSITIVE_INFINITY | NEGATIVE_INFINITY]]
213+
:type rows: list[list[int | POSITIVE_INFINITY | NEGATIVE_INFINITY]]
214214

215215
:raise RunTimeError: if *kind* is
216216
:py:attr:`MatrixKind.MaxPlusTrunc`,
@@ -225,7 +225,7 @@ The Matrix class
225225
the underlying semiring.
226226

227227

228-
.. py:method:: __init__(self: Matrix, kind: MatrixKind, threshold: int, rows: List[List[int | POSITIVE_INFINITY | NEGATIVE_INFINITY]]) -> None
228+
.. py:method:: __init__(self: Matrix, kind: MatrixKind, threshold: int, rows: list[list[int | POSITIVE_INFINITY | NEGATIVE_INFINITY]]) -> None
229229
:noindex:
230230

231231
Construct a matrix from threshold and rows.
@@ -237,7 +237,7 @@ The Matrix class
237237
:type threshold: int
238238

239239
:param rows: the rows of the matrix.
240-
:type rows: List[List[int | POSITIVE_INFINITY | NEGATIVE_INFINITY]]
240+
:type rows: list[list[int | POSITIVE_INFINITY | NEGATIVE_INFINITY]]
241241

242242
:raise RunTimeError: if *kind* is not
243243
:py:attr:`MatrixKind.MaxPlusTrunc`, or
@@ -251,7 +251,7 @@ The Matrix class
251251
the underlying semiring.
252252

253253

254-
.. py:method:: __init__(self: Matrix, kind: MatrixKind, threshold: int, period: int, rows: List[List[int | POSITIVE_INFINITY | NEGATIVE_INFINITY]]) -> None
254+
.. py:method:: __init__(self: Matrix, kind: MatrixKind, threshold: int, period: int, rows: list[list[int | POSITIVE_INFINITY | NEGATIVE_INFINITY]]) -> None
255255
:noindex:
256256

257257
Construct a matrix from rows.
@@ -266,7 +266,7 @@ The Matrix class
266266
:type period: int
267267

268268
:param rows: the rows of the matrix.
269-
:type rows: List[List[int | POSITIVE_INFINITY | NEGATIVE_INFINITY]]
269+
:type rows: list[list[int | POSITIVE_INFINITY | NEGATIVE_INFINITY]]
270270

271271
:raise RunTimeError: if *kind* is not :py:attr:`MatrixKind.NTP`.
272272

@@ -438,12 +438,12 @@ The Matrix class
438438
if *i* is greater than or equal to :any:`number_of_rows`.
439439

440440

441-
.. py:method:: rows(self: Matrix) -> List[Matrix]
441+
.. py:method:: rows(self: Matrix) -> list[Matrix]
442442
443443
Returns a list of all rows of a matrix.
444444

445445
:returns: A list of the rows.
446-
:rtype: List[Matrix]
446+
:rtype: list[Matrix]
447447

448448

449449
.. py:method:: scalar_one(self: Matrix) -> int

docs/source/data-structures/presentations/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ of the type :any:`int`, words will be lists of :any:`int` types.
2525
be changed.**
2626

2727
In what follows, we will use the pseudo-types ``Letter`` and ``Word`` instead of
28-
``str | int`` and ``str | List[int]`` to further indicate that two types of
28+
``str | int`` and ``str | list[int]`` to further indicate that two types of
2929
letters and words cannot be interchanged once a presentation is constructed.
3030

3131
All of the classes for finitely presented semigroups and monoids in

docs/source/data-structures/presentations/inverse-present.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Types
2424
In what follows, we use the following pseudo-types:
2525

2626
- ``Letter`` for ``str | int``
27-
- ``Word`` for ``str | List[int]``
27+
- ``Word`` for ``str | list[int]``
2828

2929
Recall that, once a presentation has been constructed, the type of its letters
3030
and words are fixed.

docs/source/data-structures/presentations/present-helpers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Types
2121
In what follows, we use the following pseudo-types:
2222

2323
- ``Letter`` for ``str | int``
24-
- ``Word`` for ``str | List[int]``
24+
- ``Word`` for ``str | list[int]``
2525

2626
Recall that, once a presentation has been constructed, the type of its letters
2727
and words are fixed.

docs/source/data-structures/presentations/present.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Types
2424
In what follows, we use the following pseudo-types:
2525

2626
- ``Letter`` for ``str | int``
27-
- ``Word`` for ``str | List[int]``
27+
- ``Word`` for ``str | list[int]``
2828

2929
Recall that, once a presentation has been constructed, the type of its letters
3030
and words are fixed.

docs/source/data-structures/presentations/to-inverse-present.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ Additionally, specify one of the following for *Return*:
9696

9797
- ``(InversePresentation, str)`` for constructing an
9898
- :any:`InversePresentation` over words of type ``str``.
99-
- ``(InversePresentation, List[int])`` for constructing an
100-
:any:`InversePresentation` over words of type ``List[int]``.
99+
- ``(InversePresentation, list[int])`` for constructing an
100+
:any:`InversePresentation` over words of type ``list[int]``.
101101

102102
This function behaves in one of two ways, depending on type of words in *p*, and
103103
the type of words specified in *Return*:
@@ -106,7 +106,7 @@ the type of words specified in *Return*:
106106
are not the same, this function returns an :any:`InversePresentation`
107107
equivalent to the input :any:`InversePresentation` *ip* but with words a
108108
different type (for example, can be used to convert from ``str`` to
109-
``List[int]``).
109+
``list[int]``).
110110
2. When the type of words in *ip* and type of words specified in *Return*
111111
are the same, this function just returns its argument *ip*, and is
112112
included solely for the purpose of simplifying certain client code, where
@@ -116,7 +116,7 @@ the type of words specified in *Return*:
116116
If the alphabet of of *ip* is :math:`\{a_0, a_1, \dots a_{n-1}\}`, where each
117117
letter is of type ``str``, then the conversion from one type to another is
118118
:math:`a_i \mapsto` ``human_readable_index(a_i)``. Conversely, if each letter is
119-
of type ``List[int]``, then the conversion from one type to another is
119+
of type ``list[int]``, then the conversion from one type to another is
120120
:math:`a_i \mapsto` ``human_readable_letter(a_i)``.
121121

122122
This function throws a :any:`LibsemigroupsError` if the type of words in *ip* is
@@ -131,7 +131,6 @@ not the same as that specified in *Return* and
131131

132132
.. doctest:: Python
133133

134-
>>> from typing import List
135134
>>> from libsemigroups_pybind11 import presentation, Presentation, to
136135

137136
>>> ip = InversePresentation('abc')
@@ -143,7 +142,7 @@ not the same as that specified in *Return* and
143142
>>> ip == to(ip, Return=(InversePresentation, str))
144143
True
145144

146-
>>> iq = to(ip, Return=(InversePresentation, List[int]))
145+
>>> iq = to(ip, Return=(InversePresentation, list[int]))
147146
>>> iq.alphabet()
148147
[0, 1, 2]
149148
>>> iq.inverses()
@@ -169,8 +168,8 @@ Additionally, specify one of the following for *Return*:
169168

170169
- ``(InversePresentation, str)`` for constructing an
171170
:any:`InversePresentation` over words of type ``str``.
172-
- ``(InversePresentation, List[int])`` for constructing a
173-
:any:`InversePresentation` over words of type ``List[int]``.
171+
- ``(InversePresentation, list[int])`` for constructing a
172+
:any:`InversePresentation` over words of type ``list[int]``.
174173

175174
This function returns an :any:`InversePresentation` equivalent to the input
176175
:any:`InversePresentation` *ip* but over words with letters of a different type

docs/source/data-structures/presentations/to-present.rst

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@ Additionally, specify one of the following for *Return*:
4646

4747
- ``(Presentation, str)`` for constructing a :any:`Presentation` over words
4848
of type ``str``.
49-
- ``(Presentation, List[int])`` for constructing a :any:`Presentation` over
50-
words of type ``List[int]``.
49+
- ``(Presentation, list[int])`` for constructing a :any:`Presentation` over
50+
words of type ``list[int]``.
5151

5252
This function behaves in one of two ways, depending on type of words in *p*, and
5353
the type of words specified in *Return*:
5454

5555
1. When the type of words in *p* and type of words specified in *Return* are
5656
not the same, this function returns a :any:`Presentation` equivalent to
5757
the input :any:`Presentation` *p* but with words a different type (for
58-
example, can be used to convert from ``str`` to ``List[int]``).
58+
example, can be used to convert from ``str`` to ``list[int]``).
5959
2. When the type of words in *p* and type of words specified in *Return* are
6060
the same, this function just returns its argument *p*, and is included
6161
solely for the purpose of simplifying certain client code, where
@@ -65,7 +65,7 @@ the type of words specified in *Return*:
6565
If the alphabet of of *p* is :math:`\{a_0, a_1, \dots a_{n-1}\}`, where each
6666
letter is of type ``str``, then the conversion from one type to another is
6767
:math:`a_i \mapsto` ``human_readable_index(a_i)``. Conversely, if each letter is
68-
of type ``List[int]``, then the conversion from one type to another is
68+
of type ``list[int]``, then the conversion from one type to another is
6969
:math:`a_i \mapsto` ``human_readable_letter(a_i)``.
7070

7171
This function throws a :any:`LibsemigroupsError` if the type of words in *p* is
@@ -80,7 +80,6 @@ not the same as that specified in *Return*, and
8080

8181
.. doctest:: Python
8282

83-
>>> from typing import List
8483
>>> from libsemigroups_pybind11 import presentation, Presentation, to
8584

8685
>>> p = Presentation('abcdef')
@@ -91,7 +90,7 @@ not the same as that specified in *Return*, and
9190
>>> p == to(p, Return=(Presentation, str))
9291
True
9392

94-
>>> q = to(p, Return=(Presentation, List[int]))
93+
>>> q = to(p, Return=(Presentation, list[int]))
9594
>>> q.alphabet()
9695
[0, 1, 2, 3, 4, 5]
9796
>>> q.rules
@@ -116,8 +115,8 @@ Additionally, specify one of the following for *Return*:
116115

117116
- ``(Presentation, str)`` for constructing a :any:`Presentation` over words
118117
of type ``str``.
119-
- ``(Presentation, List[int])`` for constructing a :any:`Presentation` over
120-
words of type ``List[int]``.
118+
- ``(Presentation, list[int])`` for constructing a :any:`Presentation` over
119+
words of type ``list[int]``.
121120

122121
This function returns a :any:`Presentation` equivalent to the input
123122
:any:`Presentation` *p* but over words with letters of a different type (for
@@ -136,7 +135,6 @@ specified in *Return*.
136135

137136
.. doctest:: Python
138137

139-
>>> from typing import List
140138
>>> from libsemigroups_pybind11 import presentation, Presentation, to
141139

142140
>>> p = Presentation([0, 2, 4, 6])
@@ -149,7 +147,7 @@ specified in *Return*.
149147
>>> q = to(
150148
... p, # p
151149
... double, # f
152-
... Return=(Presentation, List[int])
150+
... Return=(Presentation, list[int])
153151
... )
154152
>>> q.alphabet()
155153
[0, 4, 8, 12]
@@ -173,8 +171,8 @@ Additionally, specify one of the following for *Return*:
173171
the same type as that in *kb*.
174172
- ``(Presentation, str)`` for constructing a :any:`Presentation` over words
175173
of type ``str``.
176-
- ``(Presentation, List[int]`` for constructing a :any:`Presentation` over
177-
words of type ``List[int]``.
174+
- ``(Presentation, list[int]`` for constructing a :any:`Presentation` over
175+
words of type ``list[int]``.
178176

179177
This function constructs and returns a :any:`Presentation` object using the
180178
currently active rules of *kb*.
@@ -230,8 +228,8 @@ Additionally, specify the following for *Return*:
230228

231229
- ``(Presentation, str)`` for constructing a :any:`Presentation` over words
232230
of type ``str``.
233-
- ``(Presentation, List[int])`` for constructing a :any:`Presentation` over
234-
words of type ``List[int]``.
231+
- ``(Presentation, list[int])`` for constructing a :any:`Presentation` over
232+
words of type ``list[int]``.
235233

236234
This function constructs and returns a :any:`Presentation` object using the
237235
rules of a :any:`FroidurePin` object.

docs/source/main-algorithms/congruence/to-cong.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ Additionally, specify one of the following tuples for *Return*:
4646

4747
- ``(Congruence, str)`` for constructing a :any:`Congruence` on words of
4848
type ``str``; or
49-
- ``(Congruence, List[int])`` for constructing a :any:`Congruence` on words
50-
of type ``List[int]``.
49+
- ``(Congruence, list[int])`` for constructing a :any:`Congruence` on words
50+
of type ``list[int]``.
5151

5252
This function converts the :any:`FroidurePin` object *fpb* into a
5353
:any:`Congruence` object using the :any:`WordGraph` *wg* (which should be either

docs/source/main-algorithms/knuth-bendix/to-knuth-bendix.rst

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -157,28 +157,26 @@ Additionally, specify one of the following for *Return*:
157157
- ``(KnuthBendix, str, 'RewriteTrie')`` for constructing a
158158
:any:`KnuthBendix` on words with type ``str`` using the ``RewriteTrie'``
159159
rewriter.
160-
- ``(KnuthBendix, List[int], 'RewriteTrie')`` for constructing a
161-
:any:`KnuthBendix` on words with type ``List[int]`` using the
160+
- ``(KnuthBendix, list[int], 'RewriteTrie')`` for constructing a
161+
:any:`KnuthBendix` on words with type ``list[int]`` using the
162162
``RewriteTrie'`` rewriter.
163163
- ``(KnuthBendix, str, 'RewriteFromLeft')`` for constructing a
164164
:any:`KnuthBendix` on words with type ``str`` using the
165165
``RewriteFromLeft'`` rewriter.
166-
- ``(KnuthBendix, List[int], 'RewriteFromLeft')`` for constructing a
167-
:any:`KnuthBendix` on words with type ``List[int]`` using the
166+
- ``(KnuthBendix, list[int], 'RewriteFromLeft')`` for constructing a
167+
:any:`KnuthBendix` on words with type ``list[int]`` using the
168168
``RewriteFromLeft'`` rewriter.
169169

170170
This function converts a :any:`FroidurePin` object *fpb* to a :any:`KnuthBendix`
171171
object with the word type and rewriter as specified above. This is done using
172172
the presentation obtained from ``to(fpb, Return=(Presentation, Word)`` where
173-
``Word`` is either ``str`` or ``List[int]``.
173+
``Word`` is either ``str`` or ``list[int]``.
174174

175175
This returned :any:`KnuthBendix` object represents the trivial congruence over
176176
the semigroup defined by *fpb*.
177177

178178
.. doctest:: Python
179179

180-
>>> from typing import List
181-
182180
>>> from libsemigroups_pybind11 import (
183181
... Bipartition,
184182
... congruence_kind,
@@ -198,7 +196,7 @@ the semigroup defined by *fpb*.
198196
>>> kb = to(
199197
... congruence_kind.twosided, # knd
200198
... S, # tc
201-
... Return=(KnuthBendix, List[int], 'RewriteFromLeft')
199+
... Return=(KnuthBendix, list[int], 'RewriteFromLeft')
202200
... )
203201
>>> kb.run()
204202

docs/source/main-algorithms/todd-coxeter/to-todd-coxeter.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ Additionally, specify one of the following for *Return*:
4848

4949
- ``(ToddCoxeter, str)`` for constructing a :any:`ToddCoxeter` on words with
5050
type ``str``.
51-
- ``(ToddCoxeter, List[int])`` for constructing a :any:`ToddCoxeter` on
52-
words with type ``List[int]``.
51+
- ``(ToddCoxeter, list[int])`` for constructing a :any:`ToddCoxeter` on
52+
words with type ``list[int]``.
5353

5454
This function converts the :any:`FroidurePin` object *fpb* into a
5555
:any:`ToddCoxeter` object using the :any:`WordGraph` *wg* (which should be

0 commit comments

Comments
 (0)