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.
...stract classes for each document element type in a DocBook Python module. These abstract classes can be inherited in code that defines particular document structures, and can be nested arbitrarily, so that each maps to a different level or part of the output document's structure. As an example, suppose we want to generate the following table as part of a Word document: Name Type statex Integer statey Long The SGML text used for this table is written in terms of Local.DSL and Local...
...string - 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', respectively. As of 2.3b1, bool() without arguments returns False. (PEP 285) compile(), eval(), exec - fully support Unicode, a...
...stream is temporarily exhausted). codecs.StreamReader now implements buffering, which enables proper readline support for the UTF-16 decoders. codecs.StreamReader.read() has a new argument chars which specifies the number of characters to return. codecs.StreamReader.readline() and codecs.StreamReader.readlines() have a new argument keepends. Trailing "n"s will be stripped from the lines if keepends is false. The documentation for doctest is greatly expanded, and now covers all the new ...
...str and unicode, that fills a numeric string to the left with zeros. For example, "+123".zfill(6) -> "+00123". Complex numbers supported divmod() and the // and % operators, but these make no sense. Since this was documented, they're being deprecated now. String and unicode methods lstrip(), rstrip() and strip() now take an optional argument that specifies the characters to strip. For example, "Foo!!!?!?!?".rstrip("?!") -> "Foo". Ther...
...String_AsStringAndSize() function that provides access to the internal data buffer and size of a string object - or the default encoded version of a Unicode object. PyString_Size() and PyString_AsString() accept Unicode objects. The standard header <limits.h> is now included by Python.h (if it exists). INT_MAX and LONG_MAX will always be defined, even if <limits.h> is not available. PyFloat_FromString takes a second argument, pend, that was effectively useles...
If you didn't find what you need, try your search in the Python language documentation.