Notice: While JavaScript is not essential for this website, your interaction with the content will be limited. Please turn JavaScript on for the full experience.
...tuple([iterable]) list([iterable]) type(object) or type(name_string, bases_tuple, methods_dict) The signature of type() requires an explanation: traditionally, type(x) returns the type of object x, and this usage is still supported. However, type(name, bases, methods) is a new usage that creates a brand new type object. (This gets into metaclass programming, and I won't go into this further here except to note that this signature is the same as that used by the Don Beaudry ho...
...tuple made out of all arguments, but was undocumented. To append a tuple, use e.g. l.append((a, b, c)). The connect(), connect_ex() and bind() methods for sockets require exactly one argument. Previously, you could call s.connect(host, port), but this was undocumented. You must now write s.connect((host, port)). The str() and repr() functions are now different more often. For long integers, str() no longer appends a 'L'. Thus, str(1L) == '1', which used to be '1L'; repr(1L) is unchanged and ...
...Tuple_Pack(n, ...) for constructing tuples from a variable length argument list of Python objects without having to invoke the more complex machinery of Py_BuildValue(). PyTuple_Pack(3, a, b, c) is equivalent to Py_BuildValue("(OOO)", a, b, c). Windows The _winreg module could segfault when reading very large registry values, due to unchecked alloca() calls (SF bug 851056). The fix is uses either PyMem_Malloc(n) or PyString_FromStringAndSize(NULL, n), as appropriate, followed by ...
...tuple of classes as second argument, were looking up __instancecheck__ / __subclasscheck__ on the tuple rather than on each type object. Issue #3663: Py_None was decref'd when printing SyntaxErrors. Issue #3651: Fix various memory leaks when using the buffer interface, or when the "s#" code of PyArg_ParseTuple is given a bytes object. Issue #3657: Fix uninitialized memory read when pickling longs. Found by valgrind. Apply security patches from Apple. Fix crashes on memory allocation fa...
...tuple(class_sig) != tuple(dict_keys): print "Conformability error" # print "Class signature: " + `class_sig` # print "Dictionary keys: " + `dict_keys` print "Not matched in class signature: " + `setdiff(class_sig, common)` print "Not matched in dictionary keys: " + `setdiff(dict_keys, common)` sys.exit(1) else: for x in dict_keys: setattr(toclass, x, fromdict[x]) Listing 3 # Th...
...tuple whose nested depth is capped at the interpreter's recursion limit. Raises RuntimeError if the limit reached. Made omitted callback and None equivalent for weakref.ref() and weakref.proxy(); the None case wasn't handled correctly in all cases. Fixed problem where PyWeakref_NewRef() and PyWeakref_NewProxy() assumed that initial existing entries in an object's weakref list would not be removed while allocating a new weakref object. Since GC could be invoked at that time, however, that assum...
...tuples of (index, item). This solves the old "for i in range(len(seq))" problem more elegantly. (PEP 279) basestring - an abstract string type which is the base class for str (8-bit strings) and unicode. Primarily used to simplify tests for string-ness to isinstance(x, basestring). bool, True, False - these were introduced as ints in Python 2.2.1, but are now a separate type (a subtype of int). This means that True and False are now printed as the strings 'True' and 'False', respec...
...Tuple_Resize() which caused hard-to-interpret garbage collection crashes and possibly other, unreported crashes. Fixed a memory leak in _PyUnicode_Fini(). Build issues configure now accepts a --with-suffix option that specifies the executable suffix. This is useful for builds on Cygwin and Mac OS X, for example. The mmap.PAGESIZE constant is now initialized using sysconf when possible, which eliminates a dependency on -lucb for Reliant UNIX. The md5 file shou...
...tuple() builtin [ #420399 ] wrong HTML ("trademark" symbols?) [ #421999 ] wrong priority doc for ** vs unary - [ #422108 ] Error in rich comparisons [ #422121 ] Insecurities in dict comparison [ #422702 ] dbhash.open default [ #423087 ] A small typo in weakref documentation [ #423429 ] very minor nit in library ref [ #424776 ] SMTP Example does not work [ #424951 ] ThreadingTCPServer file handle errors. [ #425320 ] Typo in introduction. [ #427698 ] objects with __eq__ are not hashable ...
...tuple (start, end, token type, token value). In case of a syntax error, the generated parser will raise a yappsrt.SyntaxError exception. This exception will take the current position and an error message. Entering the XPath grammar into the parser was straight-forward, as shown above. Debugging the parser turned out to be easy as well, since it was possible to trace the generated Python code in a debugger, or enrich it with debugging statements. The YAPPS distribution comes with...
If you didn't find what you need, try your search in the Python language documentation.