mirror of
https://github.com/evennia/evennia.git
synced 2026-04-01 13:37:17 +02:00
issue #2243 -- prefer f-strings over %-interpolation
edited docs to prefer f-strings, then str.format(), and remove %-interpolation additional ad-hoc documentation fixes, as opportunities seen: - replace Built-In Function (BIF) "min" variable with "mins" - prefer BIF str(var) over "%s" % var - reformat some code examples to clarify multiple args passed to functions - change some single-quote strings to double-quotes for consistency - fix mismatched parens misc edits: - add .vscode/ to gitignore
This commit is contained in:
parent
f45051050e
commit
851ca30be5
30 changed files with 207 additions and 193 deletions
|
|
@ -190,7 +190,7 @@ The above could for example be used in a lock function like this:
|
|||
|
||||
```python
|
||||
# we have `obj` and `owner_object` from before
|
||||
obj.locks.add("edit: id(%i)" % owner_object.id)
|
||||
obj.locks.add(f"edit: id({owner_object.id})")
|
||||
```
|
||||
|
||||
We could check if the "edit" lock is passed with something like this:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue