我想知道Python中julia类型的“符号”的等效性,因为我试图将我正在研究的代码从julia转换为Python。
谢谢

最佳答案

intern(s)函数可能会执行您想要的操作:

>>> help(intern)
Help on built-in function intern in module __builtin__:

intern(...)
    intern(string) -> string

    ``Intern'' the given string.  This enters the string in the (global)
    table of interned strings whose purpose is to speed up dictionary lookups.
    Return the string itself or the previously interned string object with the
    same value.

>>>

关于python - 符号及其在Python中的等效项,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/55694376/

10-12 23:13