![]() Tabnanny - check Python sources for tab-width dependance. Using sre (without changes to the re API).įilecmp - supersedes the old cmp.py and dircmp.py modules. Eventually, the re module will be reimplemented Sre - regular expressions (fast, supports unicode). Robotparser - parse a robots.txt file, for writing web spiders. UserString - base class for deriving from the string type.ĭistutils - tools for distributing Python modules. Vladimir Marangozov designed more rational C APIs for allocating This mayīreak code that expects the message to be exactly the attribute The exception AttributeError will have a more friendly error message,Į.g.: 'Spam' instance has no attribute 'eggs'. Note that it has its arguments backwards: x in a causesĪ._contains_(x) to be called. You can now override the 'in' operator by defining a _contains_ Hundreds of lines of code between the reference and the assignment to This used to raise a NameError on the print statement, which confusedĮven experienced Python programmers (especially if there are several The purpose is to provide better diagnostics in the following example: This is a classĭerived from NameError so code catching NameError should still work. Used, a new exception UnboundLocalError is raised. When a local variable is known to the compiler but undefined when This makes string.atoi() and string.atol() obsolete. Indicate the conversion base - of course only if the first argument ![]() The built-ins int() and long() take an optional second argument to One or the other out: f(*args), f(**kwds). You can also use variations f(a1, a2, *args, **kwds) and you can leave f(*args, **kwds) is equivalent to apply(f, args, kwds). There's now special syntax that you can use instead of the apply()įunction. Installing, building and distributing third party packages much Greg Ward's "distutils" package is included: this will make String formatting (s % args) has a new formatting option, '%r', whichĪcts like '%s' but inserts repr(arg) instead of str(arg). Long/int unifications: long integers can be used in seek() calls, as Other changes that won't break code but are nice to know about:ĭeleting objects is now safe even for deeply nested data structures. SRE is faster than pre, and supports Unicode (which was the main reason to put effort in yet another new regular expression engine - this is at least the fourth!). You can explicitly invoke the old engine by import pre, or the SRE engine by importing sre. The new regular expression engine, SRE by Fredrik Lundh, is fully backwards compatible with the old engine, and is in fact invoked using the same interface (the "re" module).Note that the maxsplit argument defaults in split() and replace() have changed from 0 to -1. Use " ".join(sequence) for the effect of string.join(sequence) to make this more readable, try space=" " first. One peculiarity is that the equivalent of string.join(sequence, delimiter) is delimiter.join(sequence). instead of importing the string module and saying string.lower(s) etc. String methods mean that you can now say s.lower() etc.Two other big changes, related to the Unicode support, are theĪddition of string methods and a new regular expression engine: See the file Misc/unicode.txt for details, or We've added a new fundamental datatype, the Unicode string, a newīuild-in function unicode(), an numerous C APIs to deal with UnicodeĪnd encodings. Probably the most pervasive change is the addition of Unicode support. List of all new modules is included below. There are lots of new modules and lots of bugs have been fixed. ![]() Python 2.0" by Andrew Kuchling and Moshe Zadka: NortonĪntivirus version 5 on Windows 98SE doesn't have this problem either.)įor this overview, I have borrowed from the document "What's New in The same NortonĪntivirus version doesn't have this problem on Windows 2000. (Confirmed on Windows 98 SecondĮdition with Norton Antivirus version 6.10.20. ![]() Incompatibility warning: Norton Antivirus 2000Ĭan cause blue screen crashes on Windows 98 when a function in the PythonWare), you may have to remove references to it from yourĪutoexec.bat. Installed an older Python version (especially distributions from Simply rename the downloaded file to "python16.exe" before youĭouble-click it to run the installer. Notes for Windows users: Some browsers remove the ".exe" accept license and download Windows installer.The CNRI Open Source GPL-Compatible License. Python 1.6.1 is available for download now.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |