Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Python 3.3 チラ見

3,991 views

Published on

Published in: Technology
  • Be the first to comment

Python 3.3 チラ見

  1. 1. Python 3.3 ふるかわとおる
  2. 2. おまえ誰よ• @torufurukawa• 古川亨• 株式会社バスキュール号
  3. 3. リリースが近づいてまいりました 3.3.0 alpha 1: March 3, 2012 3.3.0 alpha 2: March 31, 2012 3.3.0 alpha 3: April 28, 2012 3.3.0 alpha 4: May 26, 2012 3.3.0 beta 1: June 23, 2012 (No new features beyond this point.) 3.3.0 beta 2: July 14, 2012 3.3.0 candidate 1: July 28, 2012 3.3.0 candidate 2: August 11, 2012 3.3.0 final: August 18, 2012
  4. 4. リリースが近づいてまいりました 3.3.0 alpha 1: March 3, 2012 3.3.0 alpha 2: March 31, 2012 3.3.0 alpha 3: April 28, 2012 3.3.0 alpha 4: May 26, 2012 3.3.0 beta 1: June 23, 2012 (No new features beyond this point.) 3.3.0 beta 2: July 14, 2012 3.3.0 candidate 1: July 28, 2012 3.3.0 candidate 2: August 11, 2012 3.3.0 final: August 18, 2012
  5. 5. リリースが近づいてまいりました 3.3.0 alpha 1: March 3, 2012 3.3.0 alpha 2: March 31, 2012 3.3.0 alpha 3: April 28, 2012 3.3.0 alpha 4: May 26, 2012 3.3.0 beta 1: June 23, 2012 (No new features beyond this point.) 3.3.0 beta 2: July 14, 2012 3.3.0 candidate 1: July 28, 2012 3.3.0 candidate 2: August 11, 2012 3.3.0 final: August 18, 2012
  6. 6. チラ見
  7. 7. 【u】文字列【またぁ?】
  8. 8. u
  9. 9. uPython 3.2
  10. 10. uPython 3.2>>> ほげ
  11. 11. uPython 3.2>>> ほげほげ
  12. 12. uPython 3.2>>> ほげほげ>>> uほげ
  13. 13. uPython 3.2>>> ほげほげ>>> uほげ File "<stdin>", line 1
  14. 14. uPython 3.2>>> ほげほげ>>> uほげ File "<stdin>", line 1 uほげ
  15. 15. uPython 3.2>>> ほげほげ>>> uほげ File "<stdin>", line 1 uほげ ^
  16. 16. uPython 3.2>>> ほげほげ>>> uほげ File "<stdin>", line 1 uほげ ^SyntaxError: invalid syntax
  17. 17. uPython 3.2 Python 3.3>>> ほげほげ>>> uほげ File "<stdin>", line 1 uほげ ^SyntaxError: invalid syntax
  18. 18. uPython 3.2 Python 3.3>>> ほげ >>> ほげほげ>>> uほげ File "<stdin>", line 1 uほげ ^SyntaxError: invalid syntax
  19. 19. uPython 3.2 Python 3.3>>> ほげ >>> ほげほげ ほげ>>> uほげ File "<stdin>", line 1 uほげ ^SyntaxError: invalid syntax
  20. 20. uPython 3.2 Python 3.3>>> ほげ >>> ほげほげ ほげ>>> uほげ >>> uほげ File "<stdin>", line 1 uほげ ^SyntaxError: invalid syntax
  21. 21. uPython 3.2 Python 3.3>>> ほげ >>> ほげほげ ほげ>>> uほげ >>> uほげ File "<stdin>", line 1 ほげ uほげ ^SyntaxError: invalid syntax
  22. 22. uPython 3.2 Python 3.3>>> ほげ >>> ほげほげ ほげ>>> uほげ >>> uほげ File "<stdin>", line 1 ほげ uほげ >>> ほげ == uほげ ^SyntaxError: invalid syntax
  23. 23. uPython 3.2 Python 3.3>>> ほげ >>> ほげほげ ほげ>>> uほげ >>> uほげ File "<stdin>", line 1 ほげ uほげ >>> ほげ == uほげ ^ TrueSyntaxError: invalid syntax
  24. 24. non-BMP Unicode 文字
  25. 25. non-BMP Unicode 文字Python 3.2>>> U0001F344>>> len(x)2>>> x[0], x[1](ud83c, udf4c)
  26. 26. non-BMP Unicode 文字Python 3.2 Python 3.3>>> U0001F344 >>> x = U0001F344>>> len(x) >>> len(x)2 1>>> x[0], x[1] >>> x[0](ud83c, udf4c) ud83c
  27. 27. 【yield】サブジェネレータ【next】
  28. 28. >>> def g():
  29. 29. >>> def g():... yield START
  30. 30. >>> def g():... yield START... for i in range(5):
  31. 31. >>> def g():... yield START... for i in range(5):... yield i
  32. 32. >>> def g():... yield START... for i in range(5):... yield i... yield END
  33. 33. >>> def g():... yield START... for i in range(5):... yield i... yield END...
  34. 34. >>> def g():... yield START... for i in range(5):... yield i... yield END...>>> list(g())
  35. 35. >>> def g():... yield START... for i in range(5):... yield i... yield END...>>> list(g())[START, 0, 1, 2, 3, 4, END]
  36. 36. サブジェネレータ
  37. 37. サブジェネレータ>>> def g():
  38. 38. サブジェネレータ>>> def g():... yield START
  39. 39. サブジェネレータ>>> def g():... yield START... yield from range(5)
  40. 40. サブジェネレータ>>> def g():... yield START... yield from range(5)... yield END
  41. 41. サブジェネレータ>>> def g():... yield START... yield from range(5)... yield END...
  42. 42. サブジェネレータ>>> def g():... yield START... yield from range(5)... yield END...>>> list(g())
  43. 43. サブジェネレータ>>> def g():... yield START... yield from range(5)... yield END...>>> list(g())[START, 0, 1, 2, 3, 4, END]
  44. 44. 細々ときれいになる
  45. 45. IOError のヒエラルキーがひどい+-- EnvironmentError +-- IOError +-- io.BlockingIOError +-- io.UnsupportedOperation +-- socket.error +-- socket.gaierror +-- socket.herror +-- socket.timeout +-- OSError +-- VMSError +-- WindowsError +-- mmap.error+-- select.error
  46. 46. シンプルに+-- OSError (replacing IOError, WindowsError, EnvironmentError, etc.) +-- io.BlockingIOError +-- io.UnsupportedOperation +-- socket.gaierror +-- socket.herror +-- socket.timeout
  47. 47. distutils から packaging へ
  48. 48. さよならOS/2, VMS, Windows 2000
  49. 49. 以上、チラ見せでした
  50. 50. まだ控えている PEP がありますPEP 362: Function Signature ObjectPEP 395: Module AliasingPEP 397: Python launcher for WindowsPEP 402: Simplified Package Layout (likely a new PEP derived from it)PEP 405: Python Virtual EnvironmentsPEP 412: Key-Sharing DictionaryPEP 3143: Standard daemon process libraryPEP 3144: IP Address manipulation libraryOther planned large-scale changes:Addition of the "mock" libraryAddition of the C decimal implementationAddition of the "regex" moduleEmail version 6Implementing __import__ using importlibA standard event-loop interface (PEP by Jim Fulton pending)Breaking out standard library and docs in separate repos?
  51. 51. PEP 3143: Standarddaemon process library import daemon from spam import do_main_program with daemon.DaemonContext(): do_main_program()
  52. 52. PEP 405: Python Virtual Environmentspython3 -m venv /wozozo
  53. 53. Python 3.3 をよろしく

×