- dict ถูกเขียนขึ้นใหม่โดยนำ dict ของ PyPy มาใช้งาน ทำให้ dict ใหม่นี้ใช้หน่วยความจำน้อยลงกว่า 20% และ 25% เมื่อเทียบกับ Python 3.5
- เพิ่มโมดูล secrets สำหรับใช้สร้างตัวเลขสุ่มที่ปลอดภัยสำหรับการจัดการความลับ - https://docs.python.org/3.6/library/secrets.html
- จัดรูปแบบสตริง (PEP 498: Formatted string literals) แบบ f-strings
ตัวอย่าง>>> name = "Fred" >>> f"He said his name is {name}." 'He said his name is Fred.' >>> width = 10 >>> precision = 4 >>> value = decimal.Decimal("12.34567") >>> f"result: {value:{width}.{precision}}" # nested fields 'result: 12.35'
อ่านได้ที่ https://www.python.org/dev/peps/pep-0498 - เปลี่ยน encoding ระบบไฟล์บน Windows ไปเป็น UTF-8 - https://www.python.org/dev/peps/pep-0529
- รองรับขีดเส้นใต้ในตัวอักษรตัวเลข
>>> 1_000_000_000_000_000 1000000000000000 >>> 0x_FF_FF_FF_FF 4294967295
- https://www.python.org/dev/peps/pep-0515 - PEP 525: Asynchronous Generators - https://www.python.org/dev/peps/pep-0525
- PEP 530: Asynchronous Comprehensions เพิ่ม async for - https://www.python.org/dev/peps/pep-0530
สามารถโหลด Python 3.6 ได้ที่ https://www.python.org/downloads/
0 ความคิดเห็น:
แสดงความคิดเห็น
แสดงความคิดเห็นได้ครับ :)