因此本研究在 Python 中加入一個新的型別提示 Frozen。 透過將 Frozen 標記在變數、參數、屬性等名稱上,便可以使用靜態檢查工具來檢測這些變數是否被用於修改其對應的物件。 這樣做可以提升程式的正確性、加速錯誤的排除,從而使程式開發流程更加順暢。;Language supports for immutability in programming languages can benefit the software development process, especially in imperative object-oriented programming languages. By enforcing immutability and restricting the modification of objects′ states, it becomes easier to understand the program′s execution flow. When used appropriately, immutability can also reduce the time spent on finding and fixing program errors. For programming languages with limited support for immutability, there has been research in the past on introducing new types or annotations within the language′s type or annotation system. These additions aim to mark the immutability of variables, functions, classes, and other structures. Although Python already supports the creation of immutable classes and the type hints of partial immutable types, there are still some challenges in practice that make it less straightforward.
Therefore, this research introduces a new type hint in Python called "Frozen." By applying the "Frozen" to variables, parameters, attributes, and other identifiers, static analysis tools can be used to detect if these variables are used to modify their corresponding objects. This approach makes the software development process smoother.