File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -142,12 +142,11 @@ However, these are invalid calls::
142
142
143
143
One use case for this notation is that it allows pure Python functions
144
144
to fully emulate behaviors of existing C coded functions. For example,
145
- the built-in :func: `pow ` function does not accept keyword arguments::
145
+ the built-in :func: `divmod ` function does not accept keyword arguments::
146
146
147
- def pow(x, y, z=None, /):
148
- "Emulate the built in pow() function"
149
- r = x ** y
150
- return r if z is None else r%z
147
+ def divmod(a, b, /):
148
+ "Emulate the built in divmod() function"
149
+ return (a // b, a % b)
151
150
152
151
Another use case is to preclude keyword arguments when the parameter
153
152
name is not helpful. For example, the builtin :func: `len ` function has
You can’t perform that action at this time.
0 commit comments