You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`print(*args)`: space-separated values to stdout, trailing newline. No `sep` / `end` / `file` / `flush` kwargs, pre-join for custom separators.
28
+
`print(*args)`: space-separated values to stdout, trailing newline. No `sep` / `end` / `file` / `flush` kwargs; pre-join for custom separators.
29
29
30
30
```python
31
31
print(1, 2, 3)
@@ -241,7 +241,7 @@ frozenset({2, 3, 1})
241
241
{'a': 1, 'b': 2}
242
242
```
243
243
244
-
`dict` also accepts a mapping or kwargs; iterable-of-pairs (`dict([('a', 1)])`) is not supported, use a literal or `dict.update`.
244
+
`dict` also accepts a mapping or kwargs; iterable-of-pairs (`dict([('a', 1)])`) is not supported; use a literal or `dict.update`.
245
245
246
246
### chr, ord
247
247
@@ -444,9 +444,9 @@ handle("prod", req)
444
444
handle("dev", req)
445
445
```
446
446
447
-
Candidates must be imported statically somewhere,`import_module` is a runtime *lookup*, not a *fetch*. Preserves lockfile and integrity: every reachable module is verified at compile time. Unknown name -> `NameError`; non-module global -> `TypeError`.
447
+
Candidates must be imported statically somewhere;`import_module` is a runtime *lookup*, not a *fetch*. Preserves lockfile and integrity: every reachable module is verified at compile time. Unknown name -> `NameError`; non-module global -> `TypeError`.
448
448
449
-
Dynamic loading (`importlib.import_module`, `__import__`) doesn't exist by design, static-import + runtime-dispatch replaces it.
449
+
Dynamic loading (`importlib.import_module`, `__import__`) doesn't exist by design; static-import + runtime-dispatch replaces it.
450
450
451
451
### bytes
452
452
@@ -475,7 +475,7 @@ See [Bytes](/language/data-types#bytes) for literal syntax (`b"..."`), indexing,
475
475
476
476
### bytes_fromhex, int_from_bytes, int_to_bytes
477
477
478
-
Free functions, not int/bytes methods, primitives have no bound methods (`(5).bit_length()`, `(255).to_bytes(...)` don't exist).
478
+
Free functions, not int/bytes methods — primitives have no bound methods (`(5).bit_length()`, `(255).to_bytes(...)` don't exist).
-`int_from_bytes(b, order)`: `order` is `"big"` or `"little"`. Unsigned (high bit never sign).
@@ -697,7 +697,7 @@ print(format("hi", ">10"))
697
697
698
698
## Attribute access
699
699
700
-
`getattr` / `hasattr` consult the built-in method table for primitives (str/list/dict/set/bytes) and the instance `__dict__` for user-class instances. They don't walk user-class method definitions,`hasattr(MyClass(), 'my_method')` is `False`. Functional pattern: call functions with values, don't look up methods reflectively.
700
+
`getattr` / `hasattr` consult the built-in method table for primitives (str/list/dict/set/bytes) and the instance `__dict__` for user-class instances. They don't walk user-class method definitions —`hasattr(MyClass(), 'my_method')` is `False`. Functional pattern: call functions with values, don't look up methods reflectively.
701
701
702
702
### getattr
703
703
@@ -757,7 +757,7 @@ print(f())
757
757
{'a': 1, 'b': 2}
758
758
```
759
759
760
-
Dicts are copies, mutation doesn't change VM bindings.
760
+
Dicts are copies; mutation doesn't change VM bindings.
761
761
762
762
### setattr, delattr
763
763
@@ -866,7 +866,7 @@ Concurrency primitives; full model in [Async](/language/async).
866
866
867
867
### run
868
868
869
-
`run(*coros)`: schedules every arg, drains until each reaches a terminal state, returns the first arg's result. Errors from peers other than the first are discarded, for fan-out collecting every result, use `gather`.
869
+
`run(*coros)`: schedules every arg, drains until each reaches a terminal state, returns the first arg's result. Errors from peers other than the first are discarded; for fan-out collecting every result, use `gather`.
870
870
871
871
### sleep
872
872
@@ -923,5 +923,4 @@ timed out
923
923
924
924
### cancel
925
925
926
-
`cancel(coro)`: flag a registered coroutine for cancellation; next tick stops it. Cooperative and silent, body doesn't observe `CancelledError`. For deadline-driven exception-style cancellation, use `with_timeout`.
927
-
926
+
`cancel(coro)`: flag a registered coroutine for cancellation; next tick stops it. Cooperative and silent — the body doesn't observe `CancelledError`. For deadline-driven exception-style cancellation, use `with_timeout`.
0 commit comments