diff --git a/docs/quick-start/call.md b/docs/quick-start/call.md index bbfc2a23..4899a5d6 100644 --- a/docs/quick-start/call.md +++ b/docs/quick-start/call.md @@ -13,7 +13,7 @@ For methods, `call_method` can be used. + `PyObject* call(PyObject* obj, ...)` + `PyObject* call_method(PyObject* obj, StrName name, ...)` -### Exmaple +### Example Let's create a `dict` object and set a key-value pair, which equals to the following python snippet. diff --git a/docs/quick-start/installation.md b/docs/quick-start/installation.md index ed9d20df..b7d7ccff 100644 --- a/docs/quick-start/installation.md +++ b/docs/quick-start/installation.md @@ -143,7 +143,7 @@ The constructor can take 1 extra parameters. #### `VM(bool enable_os=true)` -+ `enable_os`, whether to enable OS-related features or not. This setting controls the availability of priviledged modules such os `io` and `os` as well as builtin function `open`. **It is designed for sandboxing.** ++ `enable_os`, whether to enable OS-related features or not. This setting controls the availability of privileged modules such os `io` and `os` as well as builtin function `open`. **It is designed for sandboxing.** When you are done with the `VM` instance, use `delete` operator to dispose it. diff --git a/docs/unity/introduction.md b/docs/unity/introduction.md index 8832dd9f..b76117f6 100644 --- a/docs/unity/introduction.md +++ b/docs/unity/introduction.md @@ -57,7 +57,7 @@ PocketPython provides a sandboxed Python environment. All python code is executed in a C# virtual machine. The user cannot access the file system, network, or any other resources of the host machine. -### Seemless Interop with C# +### Seamless Interop with C# PocketPython uses `object` in C# to represent dynamic typed Python objects. Most of the basic Python types correspond to a C# type, diff --git a/include/pocketpy/config.h b/include/pocketpy/config.h index 21eb80f2..284e68bf 100644 --- a/include/pocketpy/config.h +++ b/include/pocketpy/config.h @@ -9,18 +9,18 @@ /*************** feature settings ***************/ // Whether to compile os-related modules or not -#ifndef PK_ENABLE_OS // can be overrided by cmake +#ifndef PK_ENABLE_OS // can be overridden by cmake #define PK_ENABLE_OS 0 #endif // Enable this if you are working with multi-threading (experimental) // This triggers necessary locks to make the VM thread-safe -#ifndef PK_ENABLE_THREAD // can be overrided by cmake +#ifndef PK_ENABLE_THREAD // can be overridden by cmake #define PK_ENABLE_THREAD 0 #endif // GC min threshold -#ifndef PK_GC_MIN_THRESHOLD // can be overrided by cmake +#ifndef PK_GC_MIN_THRESHOLD // can be overridden by cmake #define PK_GC_MIN_THRESHOLD 32768 #endif diff --git a/src/collections.cpp b/src/collections.cpp index 65a17f1a..79e6cece 100644 --- a/src/collections.cpp +++ b/src/collections.cpp @@ -220,7 +220,7 @@ namespace pkpy newDeque.insertObj(false, true, -1, *it); return newDequeObj; }); - // NEW: counts the number of occurences of the given object in the deque + // NEW: counts the number of occurrences of the given object in the deque vm->bind(type, "count(self, obj) -> int", [](VM *vm, ArgsView args) { @@ -290,7 +290,7 @@ namespace pkpy self.insertObj(false, false, index, obj); // this index shouldn't be fixed using vm->normalized_index, pass as is return vm->None; }); - // NEW: removes the first occurence of the given object from the deque + // NEW: removes the first occurrence of the given object from the deque vm->bind(type, "remove(self, obj) -> None", [](VM *vm, ArgsView args) { @@ -450,7 +450,7 @@ namespace pkpy /// @brief pops or removes an item from the deque /// @param front if true, pop from the front of the deque /// @param back if true, pop from the back of the deque - /// @param item if front and back is not set, remove the first occurence of item from the deque + /// @param item if front and back is not set, remove the first occurrence of item from the deque /// @param vm is needed for the py_eq /// @return PyObject* if front or back is set, this is a pop operation and we return a PyObject*, if front and back are not set, this is a remove operation and we return the removed item or nullptr PyObject *PyDeque::popObj(bool front, bool back, PyObject *item, VM *vm) diff --git a/src/expr.cpp b/src/expr.cpp index 8c9ed9cb..791e3a8c 100644 --- a/src/expr.cpp +++ b/src/expr.cpp @@ -591,7 +591,7 @@ namespace pkpy{ ctx->emit_(OP_CALL_TP, 0, line); } }else{ - // vectorcall protocal + // vectorcall protocol for(auto& item: args) item->emit_(ctx); for(auto& item: kwargs){ uint16_t index = StrName(item.first.sv()).index;