In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Editor to share with you what improvements python3 has compared to python2, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
1. Improvement of python3
1. Python3 introduces asyncio to compile asynchronous IO.
2. Print is a keyword in python2, and python3 is a function
3. Coding problem. Python3 no longer has unicode object, and str is unicode.
4. The change of division. Python 3 division returns the floating point number 5max 2 = 2.5
5. Type comments (type hint)
6. Optimized super (), which calls the method of the parent class directly.
7. Advanced unpacking operations, such as a, b, * c = range (10)
8. Limit keyword parameters, and specify parameters when there are many parameters to avoid confusion
9. Python3 will not lose stack information if it runs out of exception again.
10. Everything returns to the iterator
11. Add yield from link generator
12. Add built-in libraries such as enum,mock, asyncio, ipaddress, concurrent, futures, etc.
13. The generated pyc files are uniformly placed in pycache
14. Some built-in library modifications. Urllib,selector et al.
15. Performance optimization
2. Tools that are compatible with 2max 3
1. Six module
2, 2to3 and other tools to convert the code
3 、 future
These are all the contents of this article entitled "what are the improvements of python3 compared to python2?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.