Python 3.0 beta 1 ultra-Concise syntax usage

Source: Internet
Author: User
Tags builtin imap

Personally, the release of Python 3.0 beta 1 is more optimized and unified. If you want to have a better understanding of Python 3.0 beta 1, you can browse our article, which is a detailed introduction to its related content.

With the release of Python 3.0 beta1, this language has very simple and clear syntax features. It is suitable for completing various high-level tasks and can run in almost all operating systems. at present, technologies based on this language are rapidly developing, the number of users is rapidly expanding, and there are a lot of related resources.

Python 3.0 beta 1 was released in June 18 after a short period of time, in fact Beijing time should be 19 download: http://www.python.org/download/releases/3.0 ). Because it is the first beta version, we can see from what's new that many changes have been made, which is quite different from the previous alpha version. The biggest feature is that, in accordance with the more concise and unified spirit, the defects left by many original versions have been corrected.

Compared with the previous alpha versions, we can find that some infrastructure such as bytes, int, and unicode-related parts have gradually stabilized. For itertools, izip (), imap () all the things that replace builtin's zip, map, and other language features have been completed. It can be said that the core progress is quite good. It is estimated that the beta version is more about reorganizing the organization form of the database, fixing bugs, and optimizing the database. For py3.0, I think it's a wonderful time!

Win9x has come to an end. Python 3.0 beta 1 has removed winsound module's support for win9x. In addition, the b1 version fixes dozens of buckets. In addition, it is worth mentioning that the generator has gen. the _ name _ attribute is like the function's func. the _ name _ attribute is the same. enumerate () has a start reference. Obviously, this is required.

  • Introduction to the Python dictionary in linux
  • The prospect of the Python programming language in the eyes of its founder
  • Advantages of Python Thread Programming over Ruby applications
  • How to better learn Python built-in objects
  • Introduction to three types of Python types

One of the features of beta 1 is that many standard modules are organized in the form of packages, such as the urllib package, which includes the content of the original urllib, urllib2, urlparse, robotparse, and other modules; in addition, an http package is added, and the original httplib is changed to http. client. The Cookie is changed to http. cookies, cookieslib becomes http. cookiejar, and HTTPServer becomes http. server;

The xmlrpc package is added, including the original xmlrpclib and other modules. Previously, similar dbm, gdbm, and dbhash are all placed in the new dbm package. How does it look like there is more pythonic? The previous standard library was too messy and all of them were put under libs, so it was necessary to sort it out.

There are also many original python versions and C version libraries, such as cStringIO and StringIO, pickle and cPickle, profile and cProfile, all of which use the C version, but the module name of the original python version is retained, for example, pickle. This sort of sorting is also very necessary. Many beginners do not know which version to use. Many modules have the same functions. There is no need to give users too many choices and give the best.

In the end, the name of Queue is changed to queue, ConfigParser is changed to configparser, copy_reg is changed to copyreg, and _ winreg is changed to winreg. The APIs of the threading module have become more pythonic. We can expect that the Code style written in python 3.0 will be more unified and the readability will be better.

There are also a lot of modules to remove directly. For example, rfc822, mimetools, htmllib, and sgmllib for email processing. Commands, multifile, sre, mhlib, fpformat, dircache, Canvas, user, and mutex modules are all deleted, but some of them are rarely used. The ihooks and imputil modules related to import are also deleted. Hey, I have the code to use imputil or use imp instead. After all, the standard module is safe.

Implement PEP 3138. repr () now returns printable Unicode characters unescaped, to get an ASCII-only representation of an object use ascii (). implement PEP 3121: new module initialization and finalization API. this is the latest two PEP implementations. Basically, there is no need to pay attention to them. It is better to be transparent.

Compared with the previous alpha versions, we can find that some infrastructure such as bytes, int, and unicode-related parts have gradually stabilized. For itertools, izip (), imap () all the things that replace builtin's zip, map, and other language features have been completed. It can be said that the core progress is quite good. It is estimated that the beta version is more about reorganizing the organization form of the database, fixing bugs, and optimizing the database. For Python 3.0 beta 1, I think it's a wonderful time!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.