Python 3.6b1 ããªãªã¼ã¹ããã¾ããããï¼ãã©ã¤ã³ã°ï¼
beta1 ã¨ãããã¨ã§ã 3.6 ã«åããæ°æ©è½ã®è¿½å 㯠(provisional package ãé¤ãã¦) çµäºã§ãããã ããä»æ§ã確å®ããã¨è¨ãããã§ã¯ãªãã¦ãbetaçã«å¯¾ãããã£ã¼ãããã¯ãå ã«æ°æ©è½ãä¿®æ£ããããææª revert ã㦠3.7 ã«æã¡è¶ãã«ãããå¯è½æ§ãããã¾ãã
ãªãã 3.6b1 ãåºãåã®1é±éã core dev sprint ããããããã§ãã¡ããã¡ã大éã«å¤§ããã®å¤æ´ãå
¥ãã¾ããããªã®ã§ã常ç¨ç°å¢ã«ã¯å
¨ããªã¹ã¹ã¡ã§ãã¾ããããOSSéçºè
ã ã£ãã .travis.yml
ã« python: "nightly"
ã追å ãã¦ãªã°ã¬ãã·ã§ã³ã®çºè¦ã«è²¢ç®ãããï¼âãããã£ã¡ãæãé£ãã§ãï¼ããã以å¤ã®äººã 3.6 ã試ãã¦ã¿ã¦æ©ãã«ãã£ã¼ãããã¯ããã¦ããããã¨ãå¹´æ«ã® 3.6 ãããå®æ度ãé«ããã«ãªãã¨æãã¾ãã
ã§ã¯è¡ãã¾ããã
dict ãçã¡ã¢ãªãã¤æ¿å ¥é ãä¿æããããã«ãªã£ã
åãããããæãã¦ããã CPython ã® dict ã PyPy ã® dict ã¨åããããªä»çµã¿ã«ããããããåãè¾¼ã¾ãã¾ããã php, Ruby ã«ã¤ã¥ã㦠Python ãããã©ã«ã㧠dict ãæ¿å ¥é ãç¶æããããã«ãªãã¾ããã
ã¨ã¯ãããããããåãè¾¼ã¾ããã®ãéææ¥ã§ãã¾ã ã©ãã¾ã§ãè¨èªä»æ§ã§ã©ãããã CPython ã®å®è£
詳細ãªã®ãã¯å¾®å¦ãªã¨ããã§ãã
ä»ã®ã¨ããã® Guido ã®å®£è¨ã§ã¯ã dict ã®é åºã¯å®è£
ä¾åã§ããã¼ã¯ã¼ãå¼æ°ãåå空éã® __dict__
ã¯è¨èªä»æ§ã¨ãã¦æ¿å
¥é ãç¶æãã (ä»ã® Python 3.6 è¨èªå®è£
ã§ã¯ dict ã§ã¯ãªã OrderedDict ãªã©ã®ãµãã¯ã©ã¹ãè¿ããããããªã) ã¨ãããã¨ã«ãªãããã§ãã
ããããããããªãã¨ãããä»æ§ç¢ºèªããã«åä½ã ãè¦ã¦æãè¾¼ã¿ã§å®è£ ä¾åãªã³ã¼ããå¢ãããããªããï¼ããããããã CPython 㨠PyPy ãã¡ã¸ã£ã¼ãªå®è£ ã§ããã®2ã¤ã§åãã°ããã£ã¦å¤æãããªãããã«é ¼ãã®ã¯OKã ãããmicropython ã¯ãã¨ãã¨æ§è½ï¼è¡çªé »åº¦ï¼ãããçã¡ã¢ãªéè¦ã§ããã·ã¥ãã¼ãã«ããããªã«ã¹ã«ã¹ã«ã«ãã¦ãªããããã®å®è£ ã«è¿½å¾ãã¦ãã³ã³ãã¯ãã«ãªããªããã ãã©ããªã©ã¨ããããªæè¦ãé£ã³åºãã¦ãã¦äºæã許ãã¾ããã
å人çã«ã¯ Guido ã®æ¹éã«è³æã§ããç¹ã« IronPython ã Jython ãªã©ã® GIL ããªãå®è£ ã Python 3.6 ã«è¿½ãã¤ããã¨ãã«ããã«ãã¹ã¬ããã§æ§è½ãåºãããå®è£ ãé¸ã¶ä½å°ãæ®ãã¦ããã¦æ¬²ããããã§ãã
ã¨ãããã¨ã§ãã¿ãªããã¯ãé åºãç¶æãã¦ãããã»ããï¼ãã°ãè¦ããããªã£ããã¨ãã§ï¼ä½¿ãåæãããã©ãå¿ é ã§ã¯ãªããã¨ããã¨ããã ã dict ã®æ¿å ¥é ç¶æã«é ¼ã£ã¦ãã ããã
ãªãã OrderedDict ãæ°ãã dict ã®å®è£ ãå©ç¨ãã¦ããçã¡ã¢ãªã«ã§ããã¯ãã§ããã dict ã®æ°å®è£ ãåãè¾¼ã¾ããã®ãéææ¥ãªã®ã§ãæææ¥ã«éã«åãããã®ã¯å¦»åæã¡ã«ã¯ç¡çã ã¨æåãã諦ãã¦ã¾ããããããªããã
f-string
"{foo} and {bar}".format(foo=foo, bar=bar)
ãã f"{foo} and {bar}"
ã¨æ¸ããããã«ãªãã¾ããã {}
ã®ä¸ã«ã¯ã¡ããã¨å¼ãæ¸ãã¾ãããã£ããï¼ php ã Ruby ã«è¿½ãã¤ãããï¼
ãªãã f-string å ã§ã®ã¨ã¹ã±ã¼ãã·ã¼ã±ã³ã¹ã®ä½¿ãæ¹ã«ã¤ãã¦ã¯å¶éãããã¾ãã詳ããã¯è¨èªä»æ§ ãåç §ãã¦ãã ããã
pathlib ã使ãããããªã£ã
pathlib.Path
çµç±ã§ç´æ¥ãã¡ã¤ã«ãèªã¿æ¸ãããã¨ãã¯è¯ãã£ãã®ã§ãããä»ã®ã©ã¤ãã©ãªã¨ãã«ãã¹ã渡ãã¨ãã¯ãä»ã¾ã§ã¯æ¸¡ãã¨ãã«æååã«å¤æãã¦ãããªãã¨ãããªããã¨ãå¤ãã¦ãã¾ã使ãåæãè¯ãããã¾ããã§ããã
Python 3.6 ã§ã¯ os
ã®ããããªé¢æ°ã pathlib.Path
ããµãã¼ãããããã«ãªã£ãã®ã§ããã®ã©ã¤ãã©ãªãå¼æ°ããã®ã¾ã¾ os ã®é¢æ°ã«æ¸¡ãã¦ãããããªã¨ãã«ã¯ãæååã¸ã®å¤æãä¸è¦ã«ãªãã¾ãããããã¯ã¿ã¤ãã³ã°ä¸æ³ï¼
ãã ããã©ã¤ãã©ãªãå¼æ°ã«å¯¾ã㦠isinstance(file, str)
ã¨ããã¦ãå¼æ°ãæååãªããã¡ã¤ã«ãéãã¦ãã¡ã¤ã«ãªãã¸ã§ã¯ããªãç´æ¥ä½¿ãã¿ãããªåå²ããã¦ããå ´åã¯ããã®ã©ã¤ãã©ãªã®å¯¾å¿ãå¾
ããªãã¨ããã¾ããã
Windows ã§ãã¡ã¤ã«åãã³ã³ã½ã¼ã«å ¥åºåã utf-8 ã«
Pythonã¯åºæ¬çã« unicode æ¨ãã§ãç¹ã« Windows ã§ãã¤ãåã§ãã¡ã¤ã«åãå©ç¨ãã㨠Warning ãåºãã¤ã¤ãå
é¨ã§ã¯ Windows ã® *A
ç³» API ãå©ç¨ãã¦ãã¾ããã
ãããã Mercurial ãªã©ã®ããã«çã¾ããè²ã¡ãè¨è¨ææ³ã unix ãªããã¡ã¤ã«åããã¤ãåã¨ãã¦æ±ããã¼ã«ã Windows ã§åããã¨ãã«ãä»ããã¬ã¬ã·ã¼ãªã¨ã³ã³ã¼ãã£ã³ã°ä½¿ãã®ã¯å«ã ã¨ãã話ãããããã¡ã¤ã«åã¨ã³ã³ã½ã¼ã«å ¥åºåããã¤ãåã§è¡ã£ãã¨ã㯠utf-8 <> utf-16 å¤æãè¡ã£ã¦ W ç³» API ãå¼ã¶ããã«ãªãã¾ããã
ããã§å¾æ¹äºææ§ã«åé¡ãã§ãã¢ããªã®ããã«ãç°å¢å¤æ° PYTHONLEGACYWINDOWSSTDIO
, PYTHONLEGACYWINDOWSFSENCODING
ã§å
ã®æåã«æ»ããã¨ãã§ãã¾ãã
ãã¨ã Windows 10 Anniversary Update 㧠MAX_PATH ã® 260 æåå¶éãè¶ ããããããã«ãªãã¾ãããã Python ãåé¡ã®ãã Windows API ã使ã£ã¦ãªãã£ãã®ã§ãããã«å¯¾å¿ããããã« Manifest ãæ¸ããã¾ããã 260æåè¶ ãããã¹ãæ±ãã¾ãã
C99 解ç¦
Python ããã°ã©ãã¼ã«ã¯å ¨ãé¢ä¿ã®ãªã話ã§ããã Python ãå®è£ ããã¨ãã®Cè¨èªã®ä»æ§ã§ C99 ã®å¹¾ã¤ãã®æ©è½ããã¼ã¼ã¼ã£ã¨è§£ç¦ããã¾ããã cflags ã«ã -std=c99 ã追å ããã¾ãã
ä¾ãã°ã1è¡ã³ã¡ã³ãã //
ã§æ¸ããããã«ãªã£ãã¨ãã Py_LOCAL_INLINE(void) foo(void)
ã static inline void foo(void)
ã«ãªã£ããã¨ãã int16_t ã使ããããã«ãªã£ããã¨ãããã¼ã«ã«å¤æ°ãé¢æ°ããããã¯ã®å
é 以å¤ã®ï¼åæåããä½ç½®ã§ï¼å®£è¨ã§ããããã«ãªã£ããã¨ããetcetcãæ°ãã Python ããã«ã¼ã«ã¨ã£ã¦ã¯å¤§å¹
ã«ãªã¼ãããªãã£ãä¸ãã£ãã¨æãã¾ããåã Python ããã«ã¼ã«ãªããªããï¼
ãªããæ©é Python ã®ãã°ãã©ãã«ã¼ã«ã CentOS 5 ã®ããã©ã«ãã® GCC ã§ãã«ããéããªãï¼ã£ã¦å ±åãæ¥ã¦ã¾ããã¨ã¦ã Python ãããã§ãããæ°ãã gcc ã¤ã³ã¹ãã¼ã«ãã¦ãã ãããã¨ããã CentOS 5 ã¨ã RHEL 5 ã¨ãæ¨ã¦ã¦ãã ããã
é«éå
PythonããCã®é¢æ°ãå¼ã³åºãæãä»ã¾ã§ã¯VMã®ã¹ã¿ãã¯ããå¼æ°ãåãåºãã¦ã¿ãã«ã«å ¥ãã¦Cé¢æ°ã«æ¸¡ãã¦ãã¾ããã ãããæ°ããå ãã£ãå¼ã³åºãè¦ç´ã§ã¯ãVMã¹ã¿ãã¯ããç´æ¥å¼æ°ãåãåºããããã«ãªããä¸æãªãã¸ã§ã¯ãã¨ãã¦ã®ã¿ãã«ãä¸è¦ã«ãªãã¾ããã
ãã®å¼ã³åºãè¦ç´ã¯äººéãç´æ¥æ¸ããã¨ã¯ãã¾ãæå³ããã¦ããã Argument Clinic ã¨ãããã·ã°ããã£ã決ããããã·ã³ã¿ãã¯ã¹ã§æ¸ãã°å¼æ°è§£æã³ã¼ããèªåçæãã¦ããããã¼ã«ã使ã£ã¦å¯¾å¿ãããã¨ã«ãªãã¾ãã CPython ã®å¤ãã®ãã«ãã¤ã³é¢æ°ã¯ãã§ã«ãã®ãã¼ã«ã使ã£ã¦ããã®ã§ãããããªCã§æ¸ãããé¢æ°ã®å¼ã³åºããéããªã£ãã¯ãã§ãã
ã¾ãããã¤ãã³ã¼ãã®ãã©ã¼ããããå¤§å¹ ã«ãããã1ã¤ã®å½ä»¤ã2ãã¤ã使ãããã«ãªãã¾ãããï¼æ°ãããã©ã¼ããããåºå¥ããã¨ãã¯ã¯ã¼ãã³ã¼ãã¨å¼ã°ãã¦ã¾ããï¼ ããã«ãã Python 3.6 ã§ãå°ãé«éåããã¦ãã¯ãã§ãããæ¬æ ¼çã«æ°ãããã©ã¼ãããã®åãå¼ãåºããããªé«éå㯠3.7 ã«æã¡è¶ãã§ãã
ä»ã«ãå°æ¥ã®é«éåã¸åããä»è¾¼ã¿ã¨ãã¦ã dict ã«ï¼CPythonå
é¨ãããã使ããªããã©ã¤ãã¼ããªï¼ãã¼ã¸ã§ã³çªå·ãå
¥ã£ã¦åå解決çµæããã¼ã¸ã§ã³ãå¤ããã¾ã§ãã£ãã·ã¥ã§ããããã«ãªã£ããããã¤ãã³ã¼ããæ ¼ç´ãã¦ããã³ã¼ããªãã¸ã§ã¯ãã« co_extra
ã¨ãããã£ã¼ã«ãã追å ããã¦ãµã¼ããã¼ãã£ã¼ã®ãããã¡ã¤ã©ã¼ãJITã¨ã³ã¸ã³ãå©ç¨ã§ããããã«ããããã¦ã¾ãã
Ruby 3x3 ã話é¡ã§ããã Python ã®é«éåãããç®ãé¢ãã¾ããã