Skip to content

Commit 6c745ac

Browse files
committed
Fix section heading capitalization per qe-writing-006
Lowercase section headings to capitalize only the first word and proper nouns (e.g., Python), per QuantEcon style rules.
1 parent f4ac10d commit 6c745ac

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lectures/python_advanced_features.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ Overall, `*args` and `**kargs` are used when *defining a function*; they enable
459459

460460
The difference is that functions with `*args` will be able to take *positional arguments* with an arbitrary size, while `**kargs` will allow functions to take arbitrarily many *keyword arguments*.
461461

462-
## Type Hints
462+
## Type hints
463463

464464
```{index} single: Python; Type Hints
465465
```
@@ -476,7 +476,7 @@ Type hints were introduced in Python 3.5 and have become increasingly common in
476476
Type hints are **ignored by the Python interpreter at runtime** --- they do not affect how your code executes. They are purely informational and serve as documentation for humans and tools.
477477
```
478478

479-
### Basic Syntax
479+
### Basic syntax
480480

481481
Type hints use the colon `:` to annotate variables and parameters, and the arrow `->` to annotate return types.
482482

@@ -503,7 +503,7 @@ y: float = 3.14
503503
name: str = 'Python'
504504
```
505505

506-
### Common Types
506+
### Common types
507507

508508
The most frequently used type hints are the built-in types:
509509

@@ -523,7 +523,7 @@ prices: list[float] = [9.99, 4.50, 2.89]
523523
counts: dict[str, int] = {'apples': 3, 'oranges': 5}
524524
```
525525

526-
### Hints Don't Enforce Types
526+
### Hints don't enforce types
527527

528528
An important point for new Python programmers: type hints are **not enforced** at runtime.
529529

@@ -539,7 +539,7 @@ add('foo', 'bar')
539539

540540
This is a key difference from statically typed languages like C or Java, where mismatched types cause compilation errors.
541541

542-
### Why Use Type Hints?
542+
### Why use type hints?
543543

544544
If Python ignores them, why bother?
545545

@@ -548,7 +548,7 @@ If Python ignores them, why bother?
548548
3. **Error checking**: Tools like [mypy](https://mypy.readthedocs.io/) and [pyrefly](https://pyrefly.org/) analyze type hints to catch bugs *before* you run your code.
549549
4. **LLM-generated code**: Large language models frequently produce code with type hints, so understanding the syntax helps you read and use their output.
550550

551-
### Type Hints in Scientific Python
551+
### Type hints in scientific Python
552552

553553
Type hints connect to the {doc}`need for speed <need_for_speed>` discussion:
554554

0 commit comments

Comments
 (0)