æ¡å¼µå¼ç¨æ§æè¦ããï¼
ããããçµé¨ãããã¨ãããããList = listããã¨ãã§ä½ã大ãããªã¨æã£ã¦ãã¾ããã©ãPythonistaçã«ã¯ããããã®ãåãå ¥ããããªããã ããã
Pythonistaはtypedefすら拒絶する? (Re: Python での組み込み型をより自然な名前にする) - kなんとかの日記
Pythonã¯ä¸è²«æ§ãéè¦ããè¨èªãªã®ã§ãä»ã®è¨èªã®æ £ç¿ãæã¡è¾¼ãã§ä¸è²«æ§ãå´©ããã¨ã«å¯¾ããã¢ã¬ã«ã®ã¼åå¿ãå¼·ãã
åã«ãæ¸ãããã©ãPythonã®typeåãå°æåå§ã¾ãã§ãããã¨ã«ã¤ãã¦ã¯ãç¹ã«æè¡çãªå©ç¹ã¨ãããããã®ããããããããªãã¦ãåã«æåã®ä»æ§ãããã§ãã£ã¦ãããããã®ã¾ã¾ç¶ç¶ããã¦ããã£ã¦ããã ãã ãã? (éã£ã¦ããæãã¦ãã ãã) ã ãã大æåå§ã¾ãã®ã¨ã¤ãªã¢ã¹ãä½ããããããããªã«ç®ããããç«ã¦ããã¨ã¨ã¯æããªãããããªããtypedef unsigned int uintãã®ã»ãããã£ã½ã©ããºãã
続: Python での組み込み型をより自然な名前にする - kなんとかの日記
Cè¨èªã®æ
£ç¿ã®ä¸ã«çãã¦ããã°ã uint a,b,c ã¨ããã³ã¼ããè¦ãã¨ã uint ã unsigned int ã® typedef ã ã¨ãããã¨ãæ¨æ¸¬ã§ããã unsigned short ããã¿ã¤ãããããã£ã¦ãã大ããªå©ç¹ãããããã«ãtypedefãä¸è¬çã«ä½¿ããã¦ããããã
ããã«æ¯ã¹ã¦ãPythonã®æ
£ç¿ã®ä¸ã§çãã¦ããã¨ã list = List() ãè¦ãã¨å°æãããlistã®ååãListã«ãããã¨ã«æ義ãè¦åºãã人ãããªãããä¸è¬çã§ãªãããã
ãListã£ã¦ã®ã¯æ¨æºã®listã¨ã¯éãç¹æ®ãªã·ã¼ã±ã³ã¹åãï¼ãããã§ããªãlistã£ã¦ååãä¸æ¸ããã¦ããã ï¼ã²ãã£ã¨ããã¨Listã¯åãããªãã¦åãè¿ããã¡ã¯ããªã§ãList()ã®çµæãlistã«ä¼¼ãã·ã¼ã±ã³ã¹åãªã®ãï¼ãã£ã¦èãã¦ãListã®å®£è¨ã確èªãã¦ãããã®äººã¯ãªãã§ãããªãã¨ããã¦ãããã ï¼ãã¨ãªãã
ãã®è¨èªã®æ
£ç¿ãç¡è¦ãã¦ä»ã®äººãæ··ä¹±ãããã¨ããæå³ã§ã List = list ã¯ã typdef unsigned short ushort ãããã #define IF if( ã«è¿ãã
Ruby ã Java ã§ã¯ã¯ã©ã¹åã¯å¤§æåããå§ã¾ãã®ã§ãå¤æ°åã¨ãããã£ã³ã°ãããã¨ã¯ã»ã¼ãªããç´ æ´ãããã
Python での組み込み型をより自然な名前にする - kなんとかの日記
Javaã§ãããªããã£ãåã¯å°æåã§å§ã¾ããããint int ãªãã¦åºæ¥ãªããC#ã®stringããPythonã®çµã¿è¾¼ã¿åã¯ããããã£ãåå¨ã«è¿ãã
ããããã id:kwatch ããã¯ãã¼ã«ã«å¤æ°åã«strã¨ãlistã¨ã使ããªãã®ããã»ã©æ°ã«é£ããªãã¦ããã«ãã¤ã³åãã¿ã¤ãããããã¦ã¼ã¶ã¼å®ç¾©åã¨åºå¥ããããå°æåã§å§ããJava,C#,C++,Python ã®ä»æ§ããæªãæ £ç¿ãã¨ã¾ã§è¨ã£ã¦ãã¾ã£ã¦ãããããã®æè¦ããã¾ãä¸è¬çã§ãªããRubyè³ä¸ä¸»ç¾©ã®äººéããRubyã®ä»æ§ã¯åï¼ä»ã¯æªï¼ãã¨ãã£ã¦ä»ã®è¨èªã«ãããæ¼ãä»ãã¦ããããã«ããè¦ããªãã
ãã¨ãã°ãstrããã¼ã«ã«å¤æ°åã«ä½¿ããããã«ãªã£ãã¨ãã¦ãstrã使ãã¨ããæ
£ç¿ãã§ããã ãããï¼ãã®åã®å¤æ°ãè¤æ°ãã£ããã str, str2, str3 ã¨ã§ãããï¼ãã³ã»ã³ã¹ã ããã®å¤æ°ã«æå³ã®ããååãä»ãããããªãããã®æå³ãã¤ããã»ããè¯ããååããåã£ãå¤æ°åãã¤ããã®ã¯ãéè¦ãããªããçãã¹ã³ã¼ãã§ä½¿ãããå¤æ°ã ãã ã
ããããéè¦ãªæå³ã®ç¡ããã¼ã«ã«å¤æ°åã¨ãã«ãã¤ã³åã®ååã«ã¯ãæ¯ã¹ç©ã«ãªããªãã»ã©ã®éè¦åº¦ã®å·®ããããã ããããã¼ã«ã«å¤æ°åã®ããã«ãã«ãã¤ã³åã®ååãå¤ããããªãã¦æè¦ãPython-dev MLã«æãã人ã¯ããªãããæãã¦ãä¸ç¬ã§å´ä¸ãããã ããã
ããã ãããããããååã好ããªããè¦ãç®ã§æååé£çµã¨ããããªã Array.join ã Array.join_as_String ã¨ã§ãã¨ã¤ãªã¢ã¹ãããããã