Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5a772d3

Browse files
committed
Part II of Python2.3 update
1 parent fd6aaa1 commit 5a772d3

1 file changed

Lines changed: 24 additions & 12 deletions

File tree

Misc/cheatsheet

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ Lowest lambda args: expr anonymous function
226226
Alternate names are defined in module operator (e.g. __add__ and add for +)
227227
Most operators are overridable.
228228

229-
Many of binary operators support augmented assignment:
229+
Many binary operators also support augmented assignment:
230230
x += 1 # Same as x = x + 1
231231

232232

@@ -249,7 +249,7 @@ Notes :
249249
Comparison behavior can be overridden for a given class by defining special
250250
method __cmp__.
251251
The above comparisions return True or False which are of type bool
252-
(a subclass of int) and behave exactly as 1 or 0 except their type and
252+
(a subclass of int) and behave exactly as 1 or 0 except for their type and
253253
that they print as True or False instead of 1 or 0.
254254
(1) X < Y < Z < W has expected meaning, unlike C
255255
(2) Compare object identities (i.e. id(object)), not object values.
@@ -508,7 +508,7 @@ s.title() uppercase characters, all remaining cased characters
508508
s.translate(table return a copy of s mapped through translation table (12)
509509
[,deletechars]) table.
510510
s.upper() return a copy of s converted to uppercase.
511-
s.zfill(width) return a string padded with zeroes on the left and
511+
s.zfill(width) return a string padded with zeroes on the left side and
512512
sliding a minus sign left if necessary. never truncates.
513513

514514
Notes :
@@ -1804,13 +1804,13 @@ Bastion "Bastionification" utility (control access to instance vars)
18041804
bdb A generic Python debugger base class.
18051805
binhex Macintosh binhex compression/decompression.
18061806
bisect List bisection algorithms.
1807+
bz2 Support for bz2 compression/decompression.
18071808
calendar Calendar printing functions.
18081809
cgi Wraps the WWW Forms Common Gateway Interface (CGI).
1810+
cgitb Utility for handling CGI tracebacks.
18091811
CGIHTTPServer CGI http services.
18101812
cmd A generic class to build line-oriented command interpreters.
1811-
[DEL:cmp:DEL] [DEL:Efficiently compare files, boolean outcome only.:DEL]
1812-
[DEL:cmpcache: [DEL:Same, but caches 'stat' results for speed.:DEL]
1813-
DEL]
1813+
datetime Basic date and time types.
18141814
code Utilities needed to emulate Python's interactive interpreter
18151815
codecs Lookup existing Unicode encodings and register new ones.
18161816
colorsys Conversion functions between RGB and other color systems.
@@ -1822,11 +1822,14 @@ copy_reg Helper to provide extensibility for pickle/cPickle.
18221822
dbhash (g)dbm-compatible interface to bsdhash.hashopen.
18231823
dircache Sorted list of files in a dir, using a cache.
18241824
[DEL:dircmp:DEL] [DEL:Defines a class to build directory diff tools on.:DEL]
1825+
difflib Tool for creating delta between sequences.
18251826
dis Bytecode disassembler.
18261827
distutils Package installation system.
1828+
doctest Tool for running and verifying tests inside doc strings.
18271829
dospath Common operations on DOS pathnames.
18281830
dumbdbm A dumb and slow but simple dbm clone.
18291831
[DEL:dump:DEL] [DEL:Print python code that reconstructs a variable.:DEL]
1832+
email Comprehensive support for internet email.
18301833
exceptions Class based built-in exception hierarchy.
18311834
filecmp File comparison.
18321835
fileinput Helper class to quickly write a loop over all standard input
@@ -1845,19 +1848,24 @@ glob filename globbing.
18451848
gopherlib Gopher protocol client interface.
18461849
[DEL:grep:DEL] [DEL:'grep' utilities.:DEL]
18471850
gzip Read & write gzipped files.
1851+
heapq Priority queue implemented using lists organized as heaps.
1852+
HMAC Keyed-Hashing for Message Authentication -- RFC 2104.
18481853
htmlentitydefs Proposed entity definitions for HTML.
18491854
htmllib HTML parsing utilities.
1855+
HTMLParser A parser for HTML and XHTML.
18501856
httplib HTTP client class.
18511857
ihooks Hooks into the "import" mechanism.
18521858
imaplib IMAP4 client.Based on RFC 2060.
18531859
imghdr Recognizing image files based on their first few bytes.
18541860
imputil Privides a way of writing customised import hooks.
1861+
inspect Tool for probing live Python objects.
18551862
keyword List of Python keywords.
18561863
knee A Python re-implementation of hierarchical module import.
18571864
linecache Cache lines from files.
18581865
linuxaudiodev Lunix /dev/audio support.
18591866
locale Support for number formatting using the current locale
18601867
settings.
1868+
logging Python logging facility.
18611869
macpath Pathname (or related) operations for the Macintosh.
18621870
macurl2path Mac specific module for conversion between pathnames and URLs.
18631871
mailbox A class to handle a unix-style or mmdf-style mailbox.
@@ -1875,14 +1883,15 @@ netrc
18751883
nntplib An NNTP client class. Based on RFC 977.
18761884
ntpath Common operations on DOS pathnames.
18771885
nturl2path Mac specific module for conversion between pathnames and URLs.
1886+
optparse A comprehensive tool for processing command line options.
18781887
os Either mac, dos or posix depending system.
18791888
[DEL:packmail: [DEL:Create a self-unpacking shell archive.:DEL]
18801889
DEL]
18811890
pdb A Python debugger.
18821891
pickle Pickling (save and restore) of Python objects (a faster
18831892
Cimplementation exists in built-in module: cPickle).
18841893
pipes Conversion pipeline templates.
1885-
[DEL:poly:DEL] [DEL:Polynomials.:DEL]
1894+
pkgunil Utilities for working with Python packages.
18861895
popen2 variations on pipe open.
18871896
poplib A POP3 client class. Based on the J. Myers POP3 draft.
18881897
posixfile Extended (posix) file operations.
@@ -1891,26 +1900,25 @@ pprint Support to pretty-print lists, tuples, & dictionaries
18911900
recursively.
18921901
profile Class for profiling python code.
18931902
pstats Class for printing reports on profiled python code.
1903+
pydoc Utility for generating documentation from source files.
18941904
pty Pseudo terminal utilities.
18951905
pyexpat Interface to the Expay XML parser.
18961906
py_compile Routine to "compile" a .py file to a .pyc file.
18971907
pyclbr Parse a Python file and retrieve classes and methods.
18981908
Queue A multi-producer, multi-consumer queue.
18991909
quopri Conversions to/from quoted-printable transport encoding.
19001910
rand Don't use unless you want compatibility with C's rand().
1901-
random Random variable generators (obsolete, use whrandom)
1911+
random Random variable generators
19021912
re Regular Expressions.
19031913
reconvert Convert old ("regex") regular expressions to new syntax
19041914
("re").
1905-
regex_syntax Flags for regex.set_syntax().
1906-
regexp Backward compatibility for module "regexp" using "regex".
1907-
regsub Regular expression subroutines.
19081915
repr Redo repr() but with limits on most sizes.
19091916
rexec Restricted execution facilities ("safe" exec, eval, etc).
19101917
rfc822 RFC-822 message manipulation class.
19111918
rlcompleter Word completion for GNU readline 2.0.
19121919
robotparser Parse robot.txt files, useful for web spiders.
19131920
sched A generally useful event scheduler class.
1921+
sets Module for a set datatype.
19141922
sgmllib A parser for SGML.
19151923
shelve Manage shelves of pickled objects.
19161924
shlex Lexical analyzer class for simple shell-like syntaxes.
@@ -1932,8 +1940,10 @@ sunau Stuff to parse Sun and NeXT audio files.
19321940
sunaudio Interpret sun audio headers.
19331941
symbol Non-terminal symbols of Python grammar (from "graminit.h").
19341942
tabnanny,/font> Check Python source for ambiguous indentation.
1943+
tarfile Facility for reading and writing to the *nix tarfile format.
19351944
telnetlib TELNET client class. Based on RFC 854.
19361945
tempfile Temporary file name allocation.
1946+
textwrap Object for wrapping and filling text.
19371947
threading Proposed new higher-level threading interfaces
19381948
threading_api (doc of the threading module)
19391949
toaiff Convert "arbitrary" sound files to AIFF files .
@@ -1953,17 +1963,19 @@ UserList A wrapper to allow subclassing of built-in list class.
19531963
UserString A wrapper to allow subclassing of built-in string class.
19541964
[DEL:util:DEL] [DEL:some useful functions that don't fit elsewhere !!:DEL]
19551965
uu UUencode/UUdecode.
1966+
unittest Utilities for implementing unit testing.
19561967
wave Stuff to parse WAVE files.
1968+
weakref Tools for creating and managing weakly referenced objects.
19571969
webbrowser Platform independent URL launcher.
19581970
[DEL:whatsound: [DEL:Several routines that help recognizing sound files.:DEL]
19591971
DEL]
19601972
whichdb Guess which db package to use to open a db file.
1961-
whrandom Wichmann-Hill random number generator.
19621973
xdrlib Implements (a subset of) Sun XDR (eXternal Data
19631974
Representation)
19641975
xmllib A parser for XML, using the derived class as static DTD.
19651976
xml.dom Classes for processing XML using the Document Object Model.
19661977
xml.sax Classes for processing XML using the SAX API.
1978+
xmlrpclib Support for remote procedure calls using XML.
19671979
zipfile Read & write PK zipped files.
19681980
[DEL:zmod:DEL] [DEL:Demonstration of abstruse mathematical concepts.:DEL]
19691981

0 commit comments

Comments
 (0)