Skip to content

Commit e868fbb

Browse files
committed
Fix heading capitalization lecture-wide per qe-writing-006
Apply sentence case to all section headings (##, ###, ####) across the entire lecture, not just the new Type Hints section. Only the first word and proper nouns (e.g., Python) are capitalized.
1 parent 6c745ac commit e868fbb

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

lectures/python_advanced_features.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ It's here
3131

3232
A variety of topics are treated in the lecture, including iterators, type hints, decorators and descriptors, and generators.
3333

34-
## Iterables and Iterators
34+
## Iterables and iterators
3535

3636
```{index} single: Python; Iteration
3737
```
@@ -130,7 +130,7 @@ next(nikkei_data)
130130
next(nikkei_data)
131131
```
132132

133-
### Iterators in For Loops
133+
### Iterators in for loops
134134

135135
```{index} single: Python; Iterators
136136
```
@@ -286,14 +286,14 @@ tags: [raises-exception]
286286
max(y)
287287
```
288288

289-
## `*` and `**` Operators
289+
## `*` and `**` operators
290290

291291
`*` and `**` are convenient and widely used tools to unpack lists and tuples and to allow users to define functions that take arbitrarily many arguments as input.
292292

293293
In this section, we will explore how to use them and distinguish their use cases.
294294

295295

296-
### Unpacking Arguments
296+
### Unpacking arguments
297297

298298
When we operate on a list of parameters, we often need to extract the content of the list as individual arguments instead of a collection when passing them into functions.
299299

@@ -400,7 +400,7 @@ To summarize, when `*list`/`*tuple` and `**dictionary` are passed into *function
400400

401401
The difference is that `*` will unpack lists and tuples into *positional arguments*, while `**` will unpack dictionaries into *keyword arguments*.
402402

403-
### Arbitrary Arguments
403+
### Arbitrary arguments
404404

405405
When we *define* functions, it is sometimes desirable to allow users to put as many arguments as they want into a function.
406406

@@ -558,7 +558,7 @@ Type hints connect to the {doc}`need for speed <need_for_speed>` discussion:
558558

559559
For now, the main benefit of type hints in day-to-day Python is **clarity and tooling support**, which becomes increasingly valuable as programs grow in size.
560560

561-
## Decorators and Descriptors
561+
## Decorators and descriptors
562562

563563
```{index} single: Python; Decorators
564564
```
@@ -584,7 +584,7 @@ It's very easy to say what decorators do.
584584

585585
On the other hand it takes a bit of effort to explain *why* you might use them.
586586

587-
#### An Example
587+
#### An example
588588

589589
Suppose we are working on a program that looks something like this
590590

@@ -675,7 +675,7 @@ Now the behavior of `f` is as we desire, and the same is true of `g`.
675675

676676
At the same time, the test logic is written only once.
677677

678-
#### Enter Decorators
678+
#### Enter decorators
679679

680680
```{index} single: Python; Decorators
681681
```
@@ -776,7 +776,7 @@ In the last two lines we see that `miles` and `kms` are out of sync.
776776

777777
What we really want is some mechanism whereby each time a user sets one of these variables, *the other is automatically updated*.
778778

779-
#### A Solution
779+
#### A solution
780780

781781
In Python, this issue is solved using *descriptors*.
782782

@@ -827,7 +827,7 @@ car.kms
827827

828828
Yep, that's what we want --- `car.kms` is automatically updated.
829829

830-
#### How it Works
830+
#### How it works
831831

832832
The names `_miles` and `_kms` are arbitrary names we are using to store the values of the variables.
833833

@@ -845,7 +845,7 @@ For example, after `car` is created as an instance of `Car`, the object `car.mil
845845
Being a property, when we set its value via `car.miles = 6000` its setter
846846
method is triggered --- in this case `set_miles`.
847847

848-
#### Decorators and Properties
848+
#### Decorators and properties
849849

850850
```{index} single: Python; Decorators
851851
```
@@ -898,7 +898,7 @@ A generator is a kind of iterator (i.e., it works with a `next` function).
898898

899899
We will study two ways to build generators: generator expressions and generator functions.
900900

901-
### Generator Expressions
901+
### Generator expressions
902902

903903
The easiest way to build generators is using *generator expressions*.
904904

@@ -954,7 +954,7 @@ In fact, we can omit the outer brackets in this case
954954
sum(x * x for x in range(10))
955955
```
956956

957-
### Generator Functions
957+
### Generator functions
958958

959959
```{index} single: Python; Generator Functions
960960
```
@@ -1101,7 +1101,7 @@ def g(x):
11011101
x = x * x
11021102
```
11031103

1104-
### Advantages of Iterators
1104+
### Advantages of iterators
11051105

11061106
What's the advantage of using an iterator here?
11071107

0 commit comments

Comments
 (0)