Python中的符号及其等价物

问题描述 投票:1回答:2

我想知道Python中julia类型“符号”的等价物,因为我正在尝试翻译我正在处理的代码,从julia到Python。谢谢

python julia
2个回答
0
投票

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.

>>>

0
投票

请改用字符串。这些字符串不起作用的符号是什么?

© www.soinside.com 2019 - 2024. All rights reserved.