Skip to content

Commit 37c4e2f

Browse files
authored
Document additional primitives (#9722)
1 parent a79f1aa commit 37c4e2f

File tree

3 files changed

+20
-44
lines changed

3 files changed

+20
-44
lines changed

mypyc/doc/float_operations.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,9 @@ Construction
1616
------------
1717

1818
* Float literal
19+
* ``float(string)``
20+
21+
Functions
22+
---------
23+
24+
* ``abs(f)``

mypyc/doc/int_operations.rst

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,33 +19,16 @@ Construction
1919
Operators
2020
---------
2121

22-
Arithmetic:
23-
24-
* ``x + y``
25-
* ``x - y``
26-
* ``x * y``
27-
* ``x // y``
28-
* ``x % y``
29-
* ``-x``
30-
31-
Comparisons:
32-
33-
* ``x == y``, ``x != y``
34-
* ``x < y``, ``x <= y``, ``x > y``, ``x >= y``
22+
* Arithmetic (``+``, ``-``, ``*``, ``//``, ``%``)
23+
* Bitwise operations (``&``, ``|``, ``^``, ``<<``, ``>>``, ``~``)
24+
* Comparisons (``==``, ``!=``, ``<``, etc.)
25+
* Augmented assignment (``x += y``, etc.)
3526

3627
Statements
3728
----------
3829

3930
For loop over range:
4031

41-
* ``for x in range(end):``
42-
* ``for x in range(start, end):``
43-
* ``for x in range(start, end, step):``
44-
45-
Augmented assignment:
46-
47-
* ``x += y``
48-
* ``x -= y``
49-
* ``x *= y``
50-
* ``x //= y``
51-
* ``x %= y``
32+
* ``for x in range(end)``
33+
* ``for x in range(start, end)``
34+
* ``for x in range(start, end, step)``

mypyc/doc/str_operations.rst

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,18 @@ Construction
1616
Operators
1717
---------
1818

19-
Concatenation:
20-
21-
* ``s1 + s2``
22-
23-
Indexing:
24-
25-
* ``s[n]`` (integer index)
26-
27-
Slicing:
28-
29-
* ``s[n:m]``, ``s[n:]``, ``s[:m]``
30-
31-
Comparisons:
32-
33-
* ``s1 == s2``, ``s1 != s2``
34-
35-
Statements
36-
----------
37-
38-
* ``s1 += s2``
19+
* Concatenation (``s1 + s2``)
20+
* Indexing (``s[n]``)
21+
* Slicing (``s[n:m]``, ``s[n:]``, ``s[:m]``)
22+
* Comparisons (``==``, ``!=``)
23+
* Augmented assignment (``s1 += s2``)
3924

4025
Methods
4126
-------
4227

28+
* ``s1.endswith(s2: str)``
4329
* ``s.join(x: Iterable)``
4430
* ``s.split()``
4531
* ``s.split(sep: str)``
4632
* ``s.split(sep: str, maxsplit: int)``
33+
* ``s1.startswith(s2: str)``

0 commit comments

Comments
 (0)