Pythonã«ã¯intern()ã¨ããçµã¿è¾¼ã¿é¢æ°ããããçµæ§ç¹å¥æ±ãã§éè¦ãªçµã¿è¾¼ã¿é¢æ°ãªã®ã ãã使ãéãä»ã²ã¨ã¤åããã«ããã®ãç¥ããªã人ãå¤ãããã ã intern <æèï½¥å±éºäººç©ãªã©ã>(ä¸å®ã®åºåå ã«)æç¦ãã, æçãã. [æ°è±åï¼ç¬¬ï¼çï¼ã»åè±ï¼ç¬¬ï¼çï¼ä¸è¾å ¸ æ ªå¼ä¼ç¤¾ç 究社] ãªãã ãç©é¨ãªé¢æ°ã ããåããããªæ©è½ãæã¤Lispæã®é¢æ°ããååãæåããã®ã ãããintern()ãPythonã¹ã¯ãªããã§æ¸ãã¨ãã ããããããªæãã®å¦çã«ãªãã _intern_map = {} def intern(s): if s in _intern_map: return _intern_map[s] else: _intern_map[s] = s s.interned = True return s æååsã¨åãæååãå°ç¨ã®è¾æ¸_intern_mapã«ç»é²æ¸ã¿ãªãç»é²æ¸ã¿
{{#tags}}- {{label}}
{{/tags}}