From f2bcd1949b3ef5942b64fb4a82fc404a96d964c6 Mon Sep 17 00:00:00 2001 From: Dimitri Date: Sat, 9 Oct 2021 21:09:45 -0600 Subject: [PATCH 1/4] fix #2549 -- no reuse BIF names - fixed docs to not demonstrate reuse of built-in function names "str" and "int", even when within a one-off script - note: did *not* change the "str" and "int" shown in Howto/Starting/Part1/Learning-Typeclasses.md file, as those are class variables (i.e., Character.str and Character.int), which does not replace the BIFs of str() and int(). Therefore, methods inside the class can still use the python BIFs. While this is possibly confusing to new python programmers, it is also not within the scope of #2549. misc edits: - add .vscode/ to gitignore --- .gitignore | 3 +++ docs/source/Howto/Starting/Part1/Python-basic-introduction.md | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2b4e17a807..68662b37b9 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,6 @@ docs/build # For users of Atom .remote-sync.json + +# Visual Studio Code (VS-Code) +.vscode/ diff --git a/docs/source/Howto/Starting/Part1/Python-basic-introduction.md b/docs/source/Howto/Starting/Part1/Python-basic-introduction.md index c72c357d57..aa0be7d184 100644 --- a/docs/source/Howto/Starting/Part1/Python-basic-introduction.md +++ b/docs/source/Howto/Starting/Part1/Python-basic-introduction.md @@ -128,7 +128,7 @@ instead. Here's the stat-example again, moving the stats to variables (here we just set them, but in a real game they may be changed over time, or modified by circumstance): - > py str, dex, int = 13, 14, 8 ; print("STR: {}, DEX: {}, INT: {}".format(stren, dex, int)) + > py stren, dex, intel = 13, 14, 8 ; print("STR: {}, DEX: {dex}, INT: {}".format(stren, dex, intel)) STR: 13, DEX: 14, INT: 8 The point is that even if the values of the stats change, the print() statement would not change - it just keeps @@ -148,7 +148,7 @@ An f-string on its own is just like any other string. But let's redo the example We could just insert that `a` variable directly into the f-string using `{a}`. Fewer parentheses to remember and arguable easier to read as well. - > py str, dex, int = 13, 14, 8 ; print(f"STR: {str}, DEX: {dex}, INT: {int}") + > py stren, dex, intel = 13, 14, 8 ; print(f"STR: {stren}, DEX: {dex}, INT: {intel}") STR: 13, DEX: 14, INT: 8 We will be exploring more complex string concepts when we get to creating Commands and need to From 93bf01c737ef5660596c2023bd77dd32cf33a24a Mon Sep 17 00:00:00 2001 From: Dimitri Date: Sun, 10 Oct 2021 13:28:27 -0600 Subject: [PATCH 2/4] issue #2262 -- add docstring for location arg --- evennia/utils/create.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evennia/utils/create.py b/evennia/utils/create.py index b2b3749327..78a0739171 100644 --- a/evennia/utils/create.py +++ b/evennia/utils/create.py @@ -73,8 +73,8 @@ def create_object( typeclass (class or str): Class or python path to a typeclass. key (str): Name of the new object. If not set, a name of `#dbref` will be set. - home (Object or str): Obj or #dbref to use as the object's - home location. + location (Object or str): Obj or #dbref to use as the location of the new object. + home (Object or str): Obj or #dbref to use as the object's home location. permissions (list): A list of permission strings or tuples (permstring, category). locks (str): one or more lockstrings, separated by semicolons. aliases (list): A list of alternative keys or tuples (aliasstring, category). From 9227dd3f78fdde16cb18b507e3a2e376aab2cc85 Mon Sep 17 00:00:00 2001 From: Dimitri Date: Tue, 12 Oct 2021 07:12:12 -0600 Subject: [PATCH 3/4] issue #2262 -- add docstring for location arg --- evennia/utils/create.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evennia/utils/create.py b/evennia/utils/create.py index b2b3749327..78a0739171 100644 --- a/evennia/utils/create.py +++ b/evennia/utils/create.py @@ -73,8 +73,8 @@ def create_object( typeclass (class or str): Class or python path to a typeclass. key (str): Name of the new object. If not set, a name of `#dbref` will be set. - home (Object or str): Obj or #dbref to use as the object's - home location. + location (Object or str): Obj or #dbref to use as the location of the new object. + home (Object or str): Obj or #dbref to use as the object's home location. permissions (list): A list of permission strings or tuples (permstring, category). locks (str): one or more lockstrings, separated by semicolons. aliases (list): A list of alternative keys or tuples (aliasstring, category). From e98ea55d98180f41a18324c74c276bc4a7398c23 Mon Sep 17 00:00:00 2001 From: Dimitri Date: Tue, 12 Oct 2021 07:14:38 -0600 Subject: [PATCH 4/4] fix #2549 -- no reuse BIF names - fixed docs to not demonstrate reuse of built-in function names "str" and "int", even when within a one-off script - note: did *not* change the "str" and "int" shown in Howto/Starting/Part1/Learning-Typeclasses.md file, as those are class variables (i.e., Character.str and Character.int), which does not replace the BIFs of str() and int(). Therefore, methods inside the class can still use the python BIFs. While this is possibly confusing to new python programmers, it is also not within the scope of #2549. misc edits: - add .vscode/ to gitignore --- .gitignore | 3 +++ docs/source/Howto/Starting/Part1/Python-basic-introduction.md | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2b4e17a807..68662b37b9 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,6 @@ docs/build # For users of Atom .remote-sync.json + +# Visual Studio Code (VS-Code) +.vscode/ diff --git a/docs/source/Howto/Starting/Part1/Python-basic-introduction.md b/docs/source/Howto/Starting/Part1/Python-basic-introduction.md index c72c357d57..aa0be7d184 100644 --- a/docs/source/Howto/Starting/Part1/Python-basic-introduction.md +++ b/docs/source/Howto/Starting/Part1/Python-basic-introduction.md @@ -128,7 +128,7 @@ instead. Here's the stat-example again, moving the stats to variables (here we just set them, but in a real game they may be changed over time, or modified by circumstance): - > py str, dex, int = 13, 14, 8 ; print("STR: {}, DEX: {}, INT: {}".format(stren, dex, int)) + > py stren, dex, intel = 13, 14, 8 ; print("STR: {}, DEX: {dex}, INT: {}".format(stren, dex, intel)) STR: 13, DEX: 14, INT: 8 The point is that even if the values of the stats change, the print() statement would not change - it just keeps @@ -148,7 +148,7 @@ An f-string on its own is just like any other string. But let's redo the example We could just insert that `a` variable directly into the f-string using `{a}`. Fewer parentheses to remember and arguable easier to read as well. - > py str, dex, int = 13, 14, 8 ; print(f"STR: {str}, DEX: {dex}, INT: {int}") + > py stren, dex, intel = 13, 14, 8 ; print(f"STR: {stren}, DEX: {dex}, INT: {intel}") STR: 13, DEX: 14, INT: 8 We will be exploring more complex string concepts when we get to creating Commands and need to