mirror of
https://github.com/ItsDrike/itsdrike.com.git
synced 2025-04-19 21:32:27 +00:00
Compare commits
No commits in common. "8dff92eae9856c40f10596d7be33b433ea8c94d7" and "2433048db08da5b699e63d5d4daf2f63c7662137" have entirely different histories.
8dff92eae9
...
2433048db0
2 changed files with 7 additions and 7 deletions
|
@ -112,7 +112,7 @@ Git commits should be written in a very specific way. There's a few rules to fol
|
|||
having trouble summarizing, you might be committing too much at once)
|
||||
- **Capitalize the subject line**
|
||||
- **Don't end the subject line with a period**
|
||||
- **Use imperative mood in subject** (Imperative mood means "written as if giving a command/instruction" i.e.: "Add
|
||||
- \*Use imperative mood in subject\*\* (Imperative mood means "written as if giving a command/instruction" i.e.: "Add
|
||||
support for X", not "I added support for X" or "Support for X was added", as a rule of thumb, a subject message
|
||||
should be able to complete the sentence: "If implemented, this commit will ...")
|
||||
- **Wrap body at 72 characters** (We usually use `git log` to print out the commits into the terminal, but it's output
|
||||
|
|
|
@ -297,7 +297,7 @@ def print_items(lst: list[str]) -> None:
|
|||
# The type-checker knows `item` variable is a string now
|
||||
print(f"-> Item #{index}: {item.strip()}")
|
||||
|
||||
print_items(["hi", " hello ", "hey "])
|
||||
print_items([1, 2, 3])
|
||||
```
|
||||
|
||||
That said, in many cases, instead of using these specific collection types, you can use a less specific collection, so
|
||||
|
@ -312,12 +312,12 @@ def print_items2(lst: Sequence[str]) -> None:
|
|||
# The type-checker knows `item` variable is a string now
|
||||
print(f"Item #{index}: {item.strip()}")
|
||||
|
||||
print_items(["a", "b", "c"]) # fine
|
||||
print_items(("a", "b", "c")) # nope
|
||||
print_items([1, 2, 3]) # fine
|
||||
print_items((1, 2, 3)) # nope
|
||||
|
||||
print_items2(["a", "b", "c"]) # works
|
||||
print_items2(("a", "b", "c")) # works
|
||||
print_items2({"a", "b", "c"}) # works
|
||||
print_items2([1, 2, 3]) # works
|
||||
print_items2((1, 2, 3)) # works
|
||||
print_items2({1, 2, 3}) # works
|
||||
```
|
||||
|
||||
You may think that you could also just use a union like: `list[str] | set[str] | tuple[str, ...]`, however that still
|
||||
|
|
Loading…
Add table
Reference in a new issue