Searched refs:where (Results 1 - 25 of 32) sorted by relevance

12

/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.10/Include/
H A Dceval.h48 #define Py_EnterRecursiveCall(where) \
50 _Py_CheckRecursiveCall(where))
53 PyAPI_FUNC(int) _Py_CheckRecursiveCall(char *where);
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.2/Include/
H A Dceval.h48 #define Py_EnterRecursiveCall(where) \
50 _Py_CheckRecursiveCall(where))
53 PyAPI_FUNC(int) _Py_CheckRecursiveCall(char *where);
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.2/Lib/
H A Dcgitb.py92 where, value = lookup(token, frame, locals)
93 vars.append((token, where, value))
154 for name, where, value in vars:
158 if where in ('global', 'builtin'):
159 name = ('<em>%s</em> ' % where) + strong(name)
160 elif where == 'local':
163 name = where + strong(name.split('.')[-1])
232 for name, where, value in vars:
236 if where == 'global': name = 'global ' + name
237 elif where !
[all...]
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.10/Objects/
H A Dbytearrayobject.c1176 Return the lowest index in B where subsection sub is found,\n\
1246 Return the highest index in B where subsection sub is found,\n\
1431 Return a copy of B, where all characters occurring in the\n\
1997 /* Handle special case where both bytes have the same length */
2217 Py_ssize_t where, n = Py_SIZE(self); local
2219 if (!PyArg_ParseTuple(args, "nO:insert", &where, &value))
2232 if (where < 0) {
2233 where += n;
2234 if (where < 0)
2235 where
2357 Py_ssize_t where = -1, n = Py_SIZE(self); local
2392 Py_ssize_t where, n = Py_SIZE(self); local
[all...]
H A Dlistobject.c20 * imagine a realloc implementation where it wouldn't be true).
223 ins1(PyListObject *self, Py_ssize_t where, PyObject *v) argument
240 if (where < 0) {
241 where += n;
242 if (where < 0)
243 where = 0;
245 if (where > n)
246 where = n;
248 for (i = n; --i >= where; )
251 items[where]
256 PyList_Insert(PyObject *op, Py_ssize_t where, PyObject *newitem) argument
[all...]
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.2/Objects/
H A Dbytearrayobject.c1172 Return the lowest index in B where subsection sub is found,\n\
1242 Return the highest index in B where subsection sub is found,\n\
1427 Return a copy of B, where all characters occurring in the\n\
1993 /* Handle special case where both bytes have the same length */
2213 Py_ssize_t where, n = Py_SIZE(self); local
2215 if (!PyArg_ParseTuple(args, "nO:insert", &where, &value))
2228 if (where < 0) {
2229 where += n;
2230 if (where < 0)
2231 where
2349 Py_ssize_t where = -1, n = Py_SIZE(self); local
2384 Py_ssize_t where, n = Py_SIZE(self); local
[all...]
H A Dlistobject.c20 * imagine a realloc implementation where it wouldn't be true).
223 ins1(PyListObject *self, Py_ssize_t where, PyObject *v) argument
240 if (where < 0) {
241 where += n;
242 if (where < 0)
243 where = 0;
245 if (where > n)
246 where = n;
248 for (i = n; --i >= where; )
251 items[where]
256 PyList_Insert(PyObject *op, Py_ssize_t where, PyObject *newitem) argument
[all...]
/device/google/contexthub/firmware/os/cpu/cortexm4/
H A DappSupport.c37 uint32_t base, where; local
53 where = *ofstP + value;
54 *ofstP = where + 1;
56 mem[where] += base;
/device/linaro/bootloader/edk2/UefiCpuPkg/ResetVector/Vtf0/Ia16/
H A DResetVectorVtf0.asm24 ; sure the end of VTF0 is 4k above where the page tables end.
62 ; This is where the processor will begin execution
/device/google/contexthub/util/nanoapp_postprocess/
H A Dpostprocess.c53 uint32_t where; member in struct:RelocEntry
340 ERR(" Where: 0x%08" PRIX32, reloc->where);
356 uint32_t relocOffset = reloc->where;
362 } else if (IS_IN_RAM(reloc->where)) {
363 relocOffset = reloc->where - RAM_BASE;
494 if (IS_IN_RANGE_E(reloc->where, sect->bss_start, sect->bss_end))
496 else if (IS_IN_RANGE_E(reloc->where, sect->data_start, sect->data_end))
498 else if (IS_IN_RANGE_E(reloc->where, sect->got_start, sect->got_end))
500 else if (IS_IN_RANGE_E(reloc->where, FLASH_BASE, FLASH_BASE + sizeof(struct BinHdr)))
506 i, reloc->where, relo
[all...]
H A Dpostprocess_elf.c55 uint32_t where; member in struct:RelocEntry
366 i, relocs[i].where, relocs[i].info & 0xff, whichSym);
374 i, relocs[i].where, relocs[i].info & 0xff, whichSym, syms[whichSym].addr);
376 if (IS_IN_RANGE_E(relocs[i].where, sect->bss_start, sect->bss_end))
378 else if (IS_IN_RANGE_E(relocs[i].where, sect->data_start, sect->data_end))
380 else if (IS_IN_RANGE_E(relocs[i].where, sect->got_start, sect->got_end))
382 else if (IS_IN_RANGE_E(relocs[i].where, FLASH_BASE, FLASH_BASE + sizeof(struct BinHdr)))
390 if (IS_IN_FLASH(relocs[i].where) && relocs[i].where - FLASH_BASE < sizeof(struct BinHdr) && relocType == RELOC_TYPE_SECT) {
398 valThereP = (uint32_t*)(buf + relocs[i].where
[all...]
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.2/Python/
H A Dmactoolboxglue.c273 &e->where.h,
274 &e->where.v,
286 e->where.h,
287 e->where.v,
/device/linaro/bootloader/edk2/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibRTSM/Arm/
H A DRTSMBoot.asm41 Initialize the memory where the initial stacks will reside
/device/linaro/bootloader/edk2/ArmPlatformPkg/Library/ArmPlatformSecLibNull/Arm/
H A DArmPlatformLibNullBoot.asm36 Initialize the memory where the initial stacks will reside
/device/linaro/bootloader/edk2/UefiCpuPkg/ResetVector/Vtf0/Ia32/
H A DSearchForBfvBase.asm37 ; just below 4GB. (Addresses at 0xffHHH000 where H is any hex digit.)
/device/linaro/hikey/audio/
H A DAndroid.mk21 # The format of the name is audio.<type>.<hardware/etc>.so where the only
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.10/Modules/
H A Darraymodule.c463 ins1(arrayobject *self, Py_ssize_t where, PyObject *v) argument
477 if (where < 0) {
478 where += n;
479 if (where < 0)
480 where = 0;
482 if (where > n)
483 where = n;
485 if (where != n)
486 memmove(items + (where+1)*self->ob_descr->itemsize,
487 items + where*sel
909 ins(arrayobject *self, Py_ssize_t where, PyObject *v) argument
[all...]
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.2/Modules/
H A Darraymodule.c463 ins1(arrayobject *self, Py_ssize_t where, PyObject *v) argument
477 if (where < 0) {
478 where += n;
479 if (where < 0)
480 where = 0;
482 if (where > n)
483 where = n;
485 if (where != n)
486 memmove(items + (where+1)*self->ob_descr->itemsize,
487 items + where*sel
909 ins(arrayobject *self, Py_ssize_t where, PyObject *v) argument
[all...]
H A Dbz2module.c1025 int where = 0; local
1037 if (!PyArg_ParseTuple(args, "O|i:seek", &offobj, &where))
1066 if (where == 2) {
1091 } else if (where == 1) {
/device/linaro/bootloader/edk2/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibCTA9x4/
H A DCTA9x4Boot.asm77 Initialize the memory where the initial stacks will reside
/device/linaro/bootloader/edk2/OvmfPkg/VirtioNetDxe/
H A DTechNotes.txt108 where "[it] is safe for another driver to initialize". (Clearly another UEFI
340 (where it has been stored at VirtioNetTransmit time) and returned to the
/device/generic/goldfish-opengl/
H A Dcommon.mk221 # <dst-dir> is the destination directory where the generated sources are stored
222 # <src-dir> is the source directory where to find <basename>.attrib, etc..
/device/linaro/bootloader/edk2/AppPkg/Applications/Lua/src/
H A Dlparser.c87 const char *where = (line == 0) local
91 what, limit, where);
126 static void check_match (LexState *ls, int what, int who, int where) { argument
128 if (where == ls->linenumber)
133 luaX_token2str(ls, what), luaX_token2str(ls, who), where));
257 Mark block where variable at given level was defined
1035 ** where `binop' is any binary operator with a priority higher than `limit'
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.2/Lib/pydoc_data/
H A Dtopics.py6 'attribute-access': u'\nCustomizing attribute access\n****************************\n\nThe following methods can be defined to customize the meaning of\nattribute access (use of, assignment to, or deletion of ``x.name``)\nfor class instances.\n\nobject.__getattr__(self, name)\n\n Called when an attribute lookup has not found the attribute in the\n usual places (i.e. it is not an instance attribute nor is it found\n in the class tree for ``self``). ``name`` is the attribute name.\n This method should return the (computed) attribute value or raise\n an ``AttributeError`` exception.\n\n Note that if the attribute is found through the normal mechanism,\n ``__getattr__()`` is not called. (This is an intentional asymmetry\n between ``__getattr__()`` and ``__setattr__()``.) This is done both\n for efficiency reasons and because otherwise ``__getattr__()``\n would have no way to access other attributes of the instance. Note\n that at least for instance variables, you can fake total control by\n not inserting any values in the instance attribute dictionary (but\n instead inserting them in another object). See the\n ``__getattribute__()`` method below for a way to actually get total\n control in new-style classes.\n\nobject.__setattr__(self, name, value)\n\n Called when an attribute assignment is attempted. This is called\n instead of the normal mechanism (i.e. store the value in the\n instance dictionary). *name* is the attribute name, *value* is the\n value to be assigned to it.\n\n If ``__setattr__()`` wants to assign to an instance attribute, it\n should not simply execute ``self.name = value`` --- this would\n cause a recursive call to itself. Instead, it should insert the\n value in the dictionary of instance attributes, e.g.,\n ``self.__dict__[name] = value``. For new-style classes, rather\n than accessing the instance dictionary, it should call the base\n class method with the same name, for example,\n ``object.__setattr__(self, name, value)``.\n\nobject.__delattr__(self, name)\n\n Like ``__setattr__()`` but for attribute deletion instead of\n assignment. This should only be implemented if ``del obj.name`` is\n meaningful for the object.\n\n\nMore attribute access for new-style classes\n===========================================\n\nThe following methods only apply to new-style classes.\n\nobject.__getattribute__(self, name)\n\n Called unconditionally to implement attribute accesses for\n instances of the class. If the class also defines\n ``__getattr__()``, the latter will not be called unless\n ``__getattribute__()`` either calls it explicitly or raises an\n ``AttributeError``. This method should return the (computed)\n attribute value or raise an ``AttributeError`` exception. In order\n to avoid infinite recursion in this method, its implementation\n should always call the base class method with the same name to\n access any attributes it needs, for example,\n ``object.__getattribute__(self, name)``.\n\n Note: This method may still be bypassed when looking up special methods\n as the result of implicit invocation via language syntax or\n built-in functions. See *Special method lookup for new-style\n classes*.\n\n\nImplementing Descriptors\n========================\n\nThe following methods only apply when an instance of the class\ncontaining the method (a so-called *descriptor* class) appears in an\n*owner* class (the descriptor must be in either the owner\'s class\ndictionary or in the class dictionary for one of its parents). In the\nexamples below, "the attribute" refers to the attribute whose name is\nthe key of the property in the owner class\' ``__dict__``.\n\nobject.__get__(self, instance, owner)\n\n Called to get the attribute of the owner class (class attribute\n access) or of an instance of that class (instance attribute\n access). *owner* is always the owner class, while *instance* is the\n instance that the attribute was accessed through, or ``None`` when\n the attribute is accessed through the *owner*. This method should\n return the (computed) attribute value or raise an\n ``AttributeError`` exception.\n\nobject.__set__(self, instance, value)\n\n Called to set the attribute on an instance *instance* of the owner\n class to a new value, *value*.\n\nobject.__delete__(self, instance)\n\n Called to delete the attribute on an instance *instance* of the\n owner class.\n\n\nInvoking Descriptors\n====================\n\nIn general, a descriptor is an object attribute with "binding\nbehavior", one whose attribute access has been overridden by methods\nin the descriptor protocol: ``__get__()``, ``__set__()``, and\n``__delete__()``. If any of those methods are defined for an object,\nit is said to be a descriptor.\n\nThe default behavior for attribute access is to get, set, or delete\nthe attribute from an object\'s dictionary. For instance, ``a.x`` has a\nlookup chain starting with ``a.__dict__[\'x\']``, then\n``type(a).__dict__[\'x\']``, and continuing through the base classes of\n``type(a)`` excluding metaclasses.\n\nHowever, if the looked-up value is an object defining one of the\ndescriptor methods, then Python may override the default behavior and\ninvoke the descriptor method instead. Where this occurs in the\nprecedence chain depends on which descriptor methods were defined and\nhow they were called. Note that descriptors are only invoked for new\nstyle objects or classes (ones that subclass ``object()`` or\n``type()``).\n\nThe starting point for descriptor invocation is a binding, ``a.x``.\nHow the arguments are assembled depends on ``a``:\n\nDirect Call\n The simplest and least common call is when user code directly\n invokes a descriptor method: ``x.__get__(a)``.\n\nInstance Binding\n If binding to a new-style object instance, ``a.x`` is transformed\n into the call: ``type(a).__dict__[\'x\'].__get__(a, type(a))``.\n\nClass Binding\n If binding to a new-style class, ``A.x`` is transformed into the\n call: ``A.__dict__[\'x\'].__get__(None, A)``.\n\nSuper Binding\n If ``a`` is an instance of ``super``, then the binding ``super(B,\n obj).m()`` searches ``obj.__class__.__mro__`` for the base class\n ``A`` immediately preceding ``B`` and then invokes the descriptor\n with the call: ``A.__dict__[\'m\'].__get__(obj, obj.__class__)``.\n\nFor instance bindings, the precedence of descriptor invocation depends\non the which descriptor methods are defined. A descriptor can define\nany combination of ``__get__()``, ``__set__()`` and ``__delete__()``.\nIf it does not define ``__get__()``, then accessing the attribute will\nreturn the descriptor object itself unless there is a value in the\nobject\'s instance dictionary. If the descriptor defines ``__set__()``\nand/or ``__delete__()``, it is a data descriptor; if it defines\nneither, it is a non-data descriptor. Normally, data descriptors\ndefine both ``__get__()`` and ``__set__()``, while non-data\ndescriptors have just the ``__get__()`` method. Data descriptors with\n``__set__()`` and ``__get__()`` defined always override a redefinition\nin an instance dictionary. In contrast, non-data descriptors can be\noverridden by instances.\n\nPython methods (including ``staticmethod()`` and ``classmethod()``)\nare implemented as non-data descriptors. Accordingly, instances can\nredefine and override methods. This allows individual instances to\nacquire behaviors that differ from other instances of the same class.\n\nThe ``property()`` function is implemented as a data descriptor.\nAccordingly, instances cannot override the behavior of a property.\n\n\n__slots__\n=========\n\nBy default, instances of both old and new-style classes have a\ndictionary for attribute storage. This wastes space for objects\nhaving very few instance variables. The space consumption can become\nacute when creating large numbers of instances.\n\nThe default can be overridden by defining *__slots__* in a new-style\nclass definition. The *__slots__* declaration takes a sequence of\ninstance variables and reserves just enough space in each instance to\nhold a value for each variable. Space is saved because *__dict__* is\nnot created for each instance.\n\n__slots__\n\n This class variable can be assigned a string, iterable, or sequence\n of strings with variable names used by instances. If defined in a\n new-style class, *__slots__* reserves space for the declared\n variables and prevents the automatic creation of *__dict__* and\n *__weakref__* for each instance.\n\n New in version 2.2.\n\nNotes on using *__slots__*\n\n* When inheriting from a class without *__slots__*, the *__dict__*\n attribute of that class will always be accessible, so a *__slots__*\n definition in the subclass is meaningless.\n\n* Without a *__dict__* variable, instances cannot be assigned new\n variables not listed in the *__slots__* definition. Attempts to\n assign to an unlisted variable name raises ``AttributeError``. If\n dynamic assignment of new variables is desired, then add\n ``\'__dict__\'`` to the sequence of strings in the *__slots__*\n declaration.\n\n Changed in version 2.3: Previously, adding ``\'__dict__\'`` to the\n *__slots__* declaration would not enable the assignment of new\n attributes not specifically listed in the sequence of instance\n variable names.\n\n* Without a *__weakref__* variable for each instance, classes defining\n *__slots__* do not support weak references to its instances. If weak\n reference support is needed, then add ``\'__weakref__\'`` to the\n sequence of strings in the *__slots__* declaration.\n\n Changed in version 2.3: Previously, adding ``\'__weakref__\'`` to the\n *__slots__* declaration would not enable support for weak\n references.\n\n* *__slots__* are implemented at the class level by creating\n descriptors (*Implementing Descriptors*) for each variable name. As\n a result, class attributes cannot be used to set default values for\n instance variables defined by *__slots__*; otherwise, the class\n attribute would overwrite the descriptor assignment.\n\n* The action of a *__slots__* declaration is limited to the class\n where it is defined. As a result, subclasses will have a *__dict__*\n unless they also define *__slots__* (which must only contain names\n of any *additional* slots).\n\n* If a class defines a slot also defined in a base class, the instance\n variable defined by the base class slot is inaccessible (except by\n retrieving its descriptor directly from the base class). This\n renders the meaning of the program undefined. In the future, a\n check may be added to prevent this.\n\n* Nonempty *__slots__* does not work for classes derived from\n "variable-length" built-in types such as ``long``, ``str`` and\n ``tuple``.\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings may\n also be used; however, in the future, special meaning may be\n assigned to the values corresponding to each key.\n\n* *__class__* assignment works only if both classes have the same\n *__slots__*.\n\n Changed in version 2.6: Previously, *__class__* assignment raised an\n error if either new or old class had *__slots__*.\n',
13 'bltin-file-objects': u'\nFile Objects\n************\n\nFile objects are implemented using C\'s ``stdio`` package and can be\ncreated with the built-in ``open()`` function. File objects are also\nreturned by some other built-in functions and methods, such as\n``os.popen()`` and ``os.fdopen()`` and the ``makefile()`` method of\nsocket objects. Temporary files can be created using the ``tempfile``\nmodule, and high-level file operations such as copying, moving, and\ndeleting files and directories can be achieved with the ``shutil``\nmodule.\n\nWhen a file operation fails for an I/O-related reason, the exception\n``IOError`` is raised. This includes situations where the operation\nis not defined for some reason, like ``seek()`` on a tty device or\nwriting a file opened for reading.\n\nFiles have the following methods:\n\nfile.close()\n\n Close the file. A closed file cannot be read or written any more.\n Any operation which requires that the file be open will raise a\n ``ValueError`` after the file has been closed. Calling ``close()``\n more than once is allowed.\n\n As of Python 2.5, you can avoid having to call this method\n explicitly if you use the ``with`` statement. For example, the\n following code will automatically close *f* when the ``with`` block\n is exited:\n\n from __future__ import with_statement # This isn\'t required in Python 2.6\n\n with open("hello.txt") as f:\n for line in f:\n print line\n\n In older versions of Python, you would have needed to do this to\n get the same effect:\n\n f = open("hello.txt")\n try:\n for line in f:\n print line\n finally:\n f.close()\n\n Note: Not all "file-like" types in Python support use as a context\n manager for the ``with`` statement. If your code is intended to\n work with any file-like object, you can use the function\n ``contextlib.closing()`` instead of using the object directly.\n\nfile.flush()\n\n Flush the internal buffer, like ``stdio``\'s ``fflush()``. This may\n be a no-op on some file-like objects.\n\n Note: ``flush()`` does not necessarily write the file\'s data to disk.\n Use ``flush()`` followed by ``os.fsync()`` to ensure this\n behavior.\n\nfile.fileno()\n\n Return the integer "file descriptor" that is used by the underlying\n implementation to request I/O operations from the operating system.\n This can be useful for other, lower level interfaces that use file\n descriptors, such as the ``fcntl`` module or ``os.read()`` and\n friends.\n\n Note: File-like objects which do not have a real file descriptor should\n *not* provide this method!\n\nfile.isatty()\n\n Return ``True`` if the file is connected to a tty(-like) device,\n else ``False``.\n\n Note: If a file-like object is not associated with a real file, this\n method should *not* be implemented.\n\nfile.next()\n\n A file object is its own iterator, for example ``iter(f)`` returns\n *f* (unless *f* is closed). When a file is used as an iterator,\n typically in a ``for`` loop (for example, ``for line in f: print\n line``), the ``next()`` method is called repeatedly. This method\n returns the next input line, or raises ``StopIteration`` when EOF\n is hit when the file is open for reading (behavior is undefined\n when the file is open for writing). In order to make a ``for``\n loop the most efficient way of looping over the lines of a file (a\n very common operation), the ``next()`` method uses a hidden read-\n ahead buffer. As a consequence of using a read-ahead buffer,\n combining ``next()`` with other file methods (like ``readline()``)\n does not work right. However, using ``seek()`` to reposition the\n file to an absolute position will flush the read-ahead buffer.\n\n New in version 2.3.\n\nfile.read([size])\n\n Read at most *size* bytes from the file (less if the read hits EOF\n before obtaining *size* bytes). If the *size* argument is negative\n or omitted, read all data until EOF is reached. The bytes are\n returned as a string object. An empty string is returned when EOF\n is encountered immediately. (For certain files, like ttys, it\n makes sense to continue reading after an EOF is hit.) Note that\n this method may call the underlying C function ``fread()`` more\n than once in an effort to acquire as close to *size* bytes as\n possible. Also note that when in non-blocking mode, less data than\n was requested may be returned, even if no *size* parameter was\n given.\n\n Note: This function is simply a wrapper for the underlying ``fread()``\n C function, and will behave the same in corner cases, such as\n whether the EOF value is cached.\n\nfile.readline([size])\n\n Read one entire line from the file. A trailing newline character\n is kept in the string (but may be absent when a file ends with an\n incomplete line). [5] If the *size* argument is present and non-\n negative, it is a maximum byte count (including the trailing\n newline) and an incomplete line may be returned. When *size* is not\n 0, an empty string is returned *only* when EOF is encountered\n immediately.\n\n Note: Unlike ``stdio``\'s ``fgets()``, the returned string contains null\n characters (``\'\\0\'``) if they occurred in the input.\n\nfile.readlines([sizehint])\n\n Read until EOF using ``readline()`` and return a list containing\n the lines thus read. If the optional *sizehint* argument is\n present, instead of reading up to EOF, whole lines totalling\n approximately *sizehint* bytes (possibly after rounding up to an\n internal buffer size) are read. Objects implementing a file-like\n interface may choose to ignore *sizehint* if it cannot be\n implemented, or cannot be implemented efficiently.\n\nfile.xreadlines()\n\n This method returns the same thing as ``iter(f)``.\n\n New in version 2.1.\n\n Deprecated since version 2.3: Use ``for line in file`` instead.\n\nfile.seek(offset[, whence])\n\n Set the file\'s current position, like ``stdio``\'s ``fseek()``. The\n *whence* argument is optional and defaults to ``os.SEEK_SET`` or\n ``0`` (absolute file positioning); other values are ``os.SEEK_CUR``\n or ``1`` (seek relative to the current position) and\n ``os.SEEK_END`` or ``2`` (seek relative to the file\'s end). There\n is no return value.\n\n For example, ``f.seek(2, os.SEEK_CUR)`` advances the position by\n two and ``f.seek(-3, os.SEEK_END)`` sets the position to the third\n to last.\n\n Note that if the file is opened for appending (mode ``\'a\'`` or\n ``\'a+\'``), any ``seek()`` operations will be undone at the next\n write. If the file is only opened for writing in append mode (mode\n ``\'a\'``), this method is essentially a no-op, but it remains useful\n for files opened in append mode with reading enabled (mode\n ``\'a+\'``). If the file is opened in text mode (without ``\'b\'``),\n only offsets returned by ``tell()`` are legal. Use of other\n offsets causes undefined behavior.\n\n Note that not all file objects are seekable.\n\n Changed in version 2.6: Passing float values as offset has been\n deprecated.\n\nfile.tell()\n\n Return the file\'s current position, like ``stdio``\'s ``ftell()``.\n\n Note: On Windows, ``tell()`` can return illegal values (after an\n ``fgets()``) when reading files with Unix-style line-endings. Use\n binary mode (``\'rb\'``) to circumvent this problem.\n\nfile.truncate([size])\n\n Truncate the file\'s size. If the optional *size* argument is\n present, the file is truncated to (at most) that size. The size\n defaults to the current position. The current file position is not\n changed. Note that if a specified size exceeds the file\'s current\n size, the result is platform-dependent: possibilities include that\n the file may remain unchanged, increase to the specified size as if\n zero-filled, or increase to the specified size with undefined new\n content. Availability: Windows, many Unix variants.\n\nfile.write(str)\n\n Write a string to the file. There is no return value. Due to\n buffering, the string may not actually show up in the file until\n the ``flush()`` or ``close()`` method is called.\n\nfile.writelines(sequence)\n\n Write a sequence of strings to the file. The sequence can be any\n iterable object producing strings, typically a list of strings.\n There is no return value. (The name is intended to match\n ``readlines()``; ``writelines()`` does not add line separators.)\n\nFiles support the iterator protocol. Each iteration returns the same\nresult as ``file.readline()``, and iteration ends when the\n``readline()`` method returns an empty string.\n\nFile objects also offer a number of other interesting attributes.\nThese are not required for file-like objects, but should be\nimplemented if they make sense for the particular object.\n\nfile.closed\n\n bool indicating the current state of the file object. This is a\n read-only attribute; the ``close()`` method changes the value. It\n may not be available on all file-like objects.\n\nfile.encoding\n\n The encoding that this file uses. When Unicode strings are written\n to a file, they will be converted to byte strings using this\n encoding. In addition, when the file is connected to a terminal,\n the attribute gives the encoding that the terminal is likely to use\n (that information might be incorrect if the user has misconfigured\n the terminal). The attribute is read-only and may not be present\n on all file-like objects. It may also be ``None``, in which case\n the file uses the system default encoding for converting Unicode\n strings.\n\n New in version 2.3.\n\nfile.errors\n\n The Unicode error handler used along with the encoding.\n\n New in version 2.6.\n\nfile.mode\n\n The I/O mode for the file. If the file was created using the\n ``open()`` built-in function, this will be the value of the *mode*\n parameter. This is a read-only attribute and may not be present on\n all file-like objects.\n\nfile.name\n\n If the file object was created using ``open()``, the name of the\n file. Otherwise, some string that indicates the source of the file\n object, of the form ``<...>``. This is a read-only attribute and\n may not be present on all file-like objects.\n\nfile.newlines\n\n If Python was built with universal newlines enabled (the default)\n this read-only attribute exists, and for files opened in universal\n newline read mode it keeps track of the types of newlines\n encountered while reading the file. The values it can take are\n ``\'\\r\'``, ``\'\\n\'``, ``\'\\r\\n\'``, ``None`` (unknown, no newlines read\n yet) or a tuple containing all the newline types seen, to indicate\n that multiple newline conventions were encountered. For files not\n opened in universal newline read mode the value of this attribute\n will be ``None``.\n\nfile.softspace\n\n Boolean that indicates whether a space character needs to be\n printed before another value when using the ``print`` statement.\n Classes that are trying to simulate a file object should also have\n a writable ``softspace`` attribute, which should be initialized to\n zero. This will be automatic for most classes implemented in\n Python (care may be needed for objects that override attribute\n access); types implemented in C will have to provide a writable\n ``softspace`` attribute.\n\n Note: This attribute is not used to control the ``print`` statement,\n but to allow the implementation of ``print`` to keep track of its\n internal state.\n',
22 'comparisons': u'\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation. Also unlike C, expressions like ``a < b < c`` have the\ninterpretation that is conventional in mathematics:\n\n comparison ::= or_expr ( comp_operator or_expr )*\n comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "<>" | "!="\n | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: ``True`` or ``False``.\n\nComparisons can be chained arbitrarily, e.g., ``x < y <= z`` is\nequivalent to ``x < y and y <= z``, except that ``y`` is evaluated\nonly once (but in both cases ``z`` is not evaluated at all when ``x <\ny`` is found to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y\nopN z`` is equivalent to ``a op1 b and b op2 c and ... y opN z``,\nexcept that each expression is evaluated at most once.\n\nNote that ``a op1 b op2 c`` doesn\'t imply any kind of comparison\nbetween *a* and *c*, so that, e.g., ``x < y > z`` is perfectly legal\n(though perhaps not pretty).\n\nThe forms ``<>`` and ``!=`` are equivalent; for consistency with C,\n``!=`` is preferred; where ``!=`` is mentioned below ``<>`` is also\naccepted. The ``<>`` spelling is considered obsolescent.\n\nThe operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare\nthe values of two objects. The objects need not have the same type.\nIf both are numbers, they are converted to a common type. Otherwise,\nobjects of different types *always* compare unequal, and are ordered\nconsistently but arbitrarily. You can control comparison behavior of\nobjects of non-built-in types by defining a ``__cmp__`` method or rich\ncomparison methods like ``__gt__``, described in section *Special\nmethod names*.\n\n(This unusual definition of comparison was used to simplify the\ndefinition of operations like sorting and the ``in`` and ``not in``\noperators. In the future, the comparison rules for objects of\ndifferent types are likely to change.)\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n Unicode and 8-bit strings are fully interoperable in this behavior.\n [4]\n\n* Tuples and lists are compared lexicographically using comparison of\n corresponding elements. This means that to compare equal, each\n element must compare equal and the two sequences must be of the same\n type and have the same length.\n\n If not equal, the sequences are ordered the same as their first\n differing elements. For example, ``cmp([1,2,x], [1,2,y])`` returns\n the same as ``cmp(x,y)``. If the corresponding element does not\n exist, the shorter sequence is ordered first (for example, ``[1,2] <\n [1,2,3]``).\n\n* Mappings (dictionaries) compare equal if and only if their sorted\n (key, value) lists compare equal. [5] Outcomes other than equality\n are resolved consistently, but are not otherwise defined. [6]\n\n* Most other objects of built-in types compare unequal unless they are\n the same object; the choice whether one object is considered smaller\n or larger than another one is made arbitrarily but consistently\n within one execution of a program.\n\nThe operators ``in`` and ``not in`` test for collection membership.\n``x in s`` evaluates to true if *x* is a member of the collection *s*,\nand false otherwise. ``x not in s`` returns the negation of ``x in\ns``. The collection membership test has traditionally been bound to\nsequences; an object is a member of a collection if the collection is\na sequence and contains an element equal to that object. However, it\nmake sense for many other object types to support membership tests\nwithout being a sequence. In particular, dictionaries (for keys) and\nsets support membership testing.\n\nFor the list and tuple types, ``x in y`` is true if and only if there\nexists an index *i* such that ``x == y[i]`` is true.\n\nFor the Unicode and string types, ``x in y`` is true if and only if\n*x* is a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nNote, *x* and *y* need not be the same type; consequently, ``u\'ab\' in\n\'abc\'`` will return ``True``. Empty strings are always considered to\nbe a substring of any other string, so ``"" in "abc"`` will return\n``True``.\n\nChanged in version 2.3: Previously, *x* was required to be a string of\nlength ``1``.\n\nFor user-defined classes which define the ``__contains__()`` method,\n``x in y`` is true if and only if ``y.__contains__(x)`` is true.\n\nFor user-defined classes which do not define ``__contains__()`` but do\ndefine ``__iter__()``, ``x in y`` is true if some value ``z`` with ``x\n== z`` is produced while iterating over ``y``. If an exception is\nraised during the iteration, it is as if ``in`` raised that exception.\n\nLastly, the old-style iteration protocol is tried: if a class defines\n``__getitem__()``, ``x in y`` is true if and only if there is a non-\nnegative integer index *i* such that ``x == y[i]``, and all lower\ninteger indices do not raise ``IndexError`` exception. (If any other\nexception is raised, it is as if ``in`` raised that exception).\n\nThe operator ``not in`` is defined to have the inverse true value of\n``in``.\n\nThe operators ``is`` and ``is not`` test for object identity: ``x is\ny`` is true if and only if *x* and *y* are the same object. ``x is\nnot y`` yields the inverse truth value. [7]\n',
23 'compound': u'\nCompound statements\n*******************\n\nCompound statements contain (groups of) other statements; they affect\nor control the execution of those other statements in some way. In\ngeneral, compound statements span multiple lines, although in simple\nincarnations a whole compound statement may be contained in one line.\n\nThe ``if``, ``while`` and ``for`` statements implement traditional\ncontrol flow constructs. ``try`` specifies exception handlers and/or\ncleanup code for a group of statements. Function and class\ndefinitions are also syntactically compound statements.\n\nCompound statements consist of one or more \'clauses.\' A clause\nconsists of a header and a \'suite.\' The clause headers of a\nparticular compound statement are all at the same indentation level.\nEach clause header begins with a uniquely identifying keyword and ends\nwith a colon. A suite is a group of statements controlled by a\nclause. A suite can be one or more semicolon-separated simple\nstatements on the same line as the header, following the header\'s\ncolon, or it can be one or more indented statements on subsequent\nlines. Only the latter form of suite can contain nested compound\nstatements; the following is illegal, mostly because it wouldn\'t be\nclear to which ``if`` clause a following ``else`` clause would belong:\n\n if test1: if test2: print x\n\nAlso note that the semicolon binds tighter than the colon in this\ncontext, so that in the following example, either all or none of the\n``print`` statements are executed:\n\n if x < y < z: print x; print y; print z\n\nSummarizing:\n\n compound_stmt ::= if_stmt\n | while_stmt\n | for_stmt\n | try_stmt\n | with_stmt\n | funcdef\n | classdef\n | decorated\n suite ::= stmt_list NEWLINE | NEWLINE INDENT statement+ DEDENT\n statement ::= stmt_list NEWLINE | compound_stmt\n stmt_list ::= simple_stmt (";" simple_stmt)* [";"]\n\nNote that statements always end in a ``NEWLINE`` possibly followed by\na ``DEDENT``. Also note that optional continuation clauses always\nbegin with a keyword that cannot start a statement, thus there are no\nambiguities (the \'dangling ``else``\' problem is solved in Python by\nrequiring nested ``if`` statements to be indented).\n\nThe formatting of the grammar rules in the following sections places\neach clause on a separate line for clarity.\n\n\nThe ``if`` statement\n====================\n\nThe ``if`` statement is used for conditional execution:\n\n if_stmt ::= "if" expression ":" suite\n ( "elif" expression ":" suite )*\n ["else" ":" suite]\n\nIt selects exactly one of the suites by evaluating the expressions one\nby one until one is found to be true (see section *Boolean operations*\nfor the definition of true and false); then that suite is executed\n(and no other part of the ``if`` statement is executed or evaluated).\nIf all expressions are false, the suite of the ``else`` clause, if\npresent, is executed.\n\n\nThe ``while`` statement\n=======================\n\nThe ``while`` statement is used for repeated execution as long as an\nexpression is true:\n\n while_stmt ::= "while" expression ":" suite\n ["else" ":" suite]\n\nThis repeatedly tests the expression and, if it is true, executes the\nfirst suite; if the expression is false (which may be the first time\nit is tested) the suite of the ``else`` clause, if present, is\nexecuted and the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ngoes back to testing the expression.\n\n\nThe ``for`` statement\n=====================\n\nThe ``for`` statement is used to iterate over the elements of a\nsequence (such as a string, tuple or list) or other iterable object:\n\n for_stmt ::= "for" target_list "in" expression_list ":" suite\n ["else" ":" suite]\n\nThe expression list is evaluated once; it should yield an iterable\nobject. An iterator is created for the result of the\n``expression_list``. The suite is then executed once for each item\nprovided by the iterator, in the order of ascending indices. Each\nitem in turn is assigned to the target list using the standard rules\nfor assignments, and then the suite is executed. When the items are\nexhausted (which is immediately when the sequence is empty), the suite\nin the ``else`` clause, if present, is executed, and the loop\nterminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ncontinues with the next item, or with the ``else`` clause if there was\nno next item.\n\nThe suite may assign to the variable(s) in the target list; this does\nnot affect the next item assigned to it.\n\nThe target list is not deleted when the loop is finished, but if the\nsequence is empty, it will not have been assigned to at all by the\nloop. Hint: the built-in function ``range()`` returns a sequence of\nintegers suitable to emulate the effect of Pascal\'s ``for i := a to b\ndo``; e.g., ``range(3)`` returns the list ``[0, 1, 2]``.\n\nNote: There is a subtlety when the sequence is being modified by the loop\n (this can only occur for mutable sequences, i.e. lists). An internal\n counter is used to keep track of which item is used next, and this\n is incremented on each iteration. When this counter has reached the\n length of the sequence the loop terminates. This means that if the\n suite deletes the current (or a previous) item from the sequence,\n the next item will be skipped (since it gets the index of the\n current item which has already been treated). Likewise, if the\n suite inserts an item in the sequence before the current item, the\n current item will be treated again the next time through the loop.\n This can lead to nasty bugs that can be avoided by making a\n temporary copy using a slice of the whole sequence, e.g.,\n\n for x in a[:]:\n if x < 0: a.remove(x)\n\n\nThe ``try`` statement\n=====================\n\nThe ``try`` statement specifies exception handlers and/or cleanup code\nfor a group of statements:\n\n try_stmt ::= try1_stmt | try2_stmt\n try1_stmt ::= "try" ":" suite\n ("except" [expression [("as" | ",") target]] ":" suite)+\n ["else" ":" suite]\n ["finally" ":" suite]\n try2_stmt ::= "try" ":" suite\n "finally" ":" suite\n\nChanged in version 2.5: In previous versions of Python,\n``try``...``except``...``finally`` did not work. ``try``...``except``\nhad to be nested in ``try``...``finally``.\n\nThe ``except`` clause(s) specify one or more exception handlers. When\nno exception occurs in the ``try`` clause, no exception handler is\nexecuted. When an exception occurs in the ``try`` suite, a search for\nan exception handler is started. This search inspects the except\nclauses in turn until one is found that matches the exception. An\nexpression-less except clause, if present, must be last; it matches\nany exception. For an except clause with an expression, that\nexpression is evaluated, and the clause matches the exception if the\nresulting object is "compatible" with the exception. An object is\ncompatible with an exception if it is the class or a base class of the\nexception object, a tuple containing an item compatible with the\nexception, or, in the (deprecated) case of string exceptions, is the\nraised string itself (note that the object identities must match, i.e.\nit must be the same string object, not just a string with the same\nvalue).\n\nIf no except clause matches the exception, the search for an exception\nhandler continues in the surrounding code and on the invocation stack.\n[1]\n\nIf the evaluation of an expression in the header of an except clause\nraises an exception, the original search for a handler is canceled and\na search starts for the new exception in the surrounding code and on\nthe call stack (it is treated as if the entire ``try`` statement\nraised the exception).\n\nWhen a matching except clause is found, the exception is assigned to\nthe target specified in that except clause, if present, and the except\nclause\'s suite is executed. All except clauses must have an\nexecutable block. When the end of this block is reached, execution\ncontinues normally after the entire try statement. (This means that\nif two nested handlers exist for the same exception, and the exception\noccurs in the try clause of the inner handler, the outer handler will\nnot handle the exception.)\n\nBefore an except clause\'s suite is executed, details about the\nexception are assigned to three variables in the ``sys`` module:\n``sys.exc_type`` receives the object identifying the exception;\n``sys.exc_value`` receives the exception\'s parameter;\n``sys.exc_traceback`` receives a traceback object (see section *The\nstandard type hierarchy*) identifying the point in the program where\nthe exception occurred. These details are also available through the\n``sys.exc_info()`` function, which returns a tuple ``(exc_type,\nexc_value, exc_traceback)``. Use of the corresponding variables is\ndeprecated in favor of this function, since their use is unsafe in a\nthreaded program. As of Python 1.5, the variables are restored to\ntheir previous values (before the call) when returning from a function\nthat handled an exception.\n\nThe optional ``else`` clause is executed if and when control flows off\nthe end of the ``try`` clause. [2] Exceptions in the ``else`` clause\nare not handled by the preceding ``except`` clauses.\n\nIf ``finally`` is present, it specifies a \'cleanup\' handler. The\n``try`` clause is executed, including any ``except`` and ``else``\nclauses. If an exception occurs in any of the clauses and is not\nhandled, the exception is temporarily saved. The ``finally`` clause is\nexecuted. If there is a saved exception, it is re-raised at the end\nof the ``finally`` clause. If the ``finally`` clause raises another\nexception or executes a ``return`` or ``break`` statement, the saved\nexception is lost. The exception information is not available to the\nprogram during execution of the ``finally`` clause.\n\nWhen a ``return``, ``break`` or ``continue`` statement is executed in\nthe ``try`` suite of a ``try``...``finally`` statement, the\n``finally`` clause is also executed \'on the way out.\' A ``continue``\nstatement is illegal in the ``finally`` clause. (The reason is a\nproblem with the current implementation --- this restriction may be\nlifted in the future).\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information on using the ``raise`` statement to\ngenerate exceptions may be found in section *The raise statement*.\n\n\nThe ``with`` statement\n======================\n\nNew in version 2.5.\n\nThe ``with`` statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common\n``try``...``except``...``finally`` usage patterns to be encapsulated\nfor convenient reuse.\n\n with_stmt ::= "with" with_item ("," with_item)* ":" suite\n with_item ::= expression ["as" target]\n\nThe execution of the ``with`` statement with one "item" proceeds as\nfollows:\n\n1. The context expression (the expression given in the **with_item**)\n is evaluated to obtain a context manager.\n\n2. The context manager\'s ``__exit__()`` is loaded for later use.\n\n3. The context manager\'s ``__enter__()`` method is invoked.\n\n4. If a target was included in the ``with`` statement, the return\n value from ``__enter__()`` is assigned to it.\n\n Note: The ``with`` statement guarantees that if the ``__enter__()``\n method returns without an error, then ``__exit__()`` will always\n be called. Thus, if an error occurs during the assignment to the\n target list, it will be treated the same as an error occurring\n within the suite would be. See step 6 below.\n\n5. The suite is executed.\n\n6. The context manager\'s ``__exit__()`` method is invoked. If an\n exception caused the suite to be exited, its type, value, and\n traceback are passed as arguments to ``__exit__()``. Otherwise,\n three ``None`` arguments are supplied.\n\n If the suite was exited due to an exception, and the return value\n from the ``__exit__()`` method was false, the exception is\n reraised. If the return value was true, the exception is\n suppressed, and execution continues with the statement following\n the ``with`` statement.\n\n If the suite was exited for any reason other than an exception, the\n return value from ``__exit__()`` is ignored, and execution proceeds\n at the normal location for the kind of exit that was taken.\n\nWith more than one item, the context managers are processed as if\nmultiple ``with`` statements were nested:\n\n with A() as a, B() as b:\n suite\n\nis equivalent to\n\n with A() as a:\n with B() as b:\n suite\n\nNote: In Python 2.5, the ``with`` statement is only allowed when the\n ``with_statement`` feature has been enabled. It is always enabled\n in Python 2.6.\n\nChanged in version 2.7: Support for multiple context expressions.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n\nFunction definitions\n====================\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n decorated ::= decorators (classdef | funcdef)\n decorators ::= decorator+\n decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE\n funcdef ::= "def" funcname "(" [parameter_list] ")" ":" suite\n dotted_name ::= identifier ("." identifier)*\n parameter_list ::= (defparameter ",")*\n ( "*" identifier [, "**" identifier]\n | "**" identifier\n | defparameter [","] )\n defparameter ::= parameter ["=" expression]\n sublist ::= parameter ("," parameter)* [","]\n parameter ::= identifier | "(" sublist ")"\n funcname ::= identifier\n\nA function definition is an executable statement. Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function). This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called. [3]\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition. The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object. Multiple decorators are applied in\nnested fashion. For example, the following code:\n\n @f1(arg)\n @f2\n def func(): pass\n\nis equivalent to:\n\n def func(): pass\n func = f1(arg)(f2(func))\n\nWhen one or more top-level parameters have the form *parameter* ``=``\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding argument may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted. If a parameter has a default value, all following\nparameters must also have a default value --- this is a syntactic\nrestriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated when the function definition\nis executed.** This means that the expression is evaluated once, when\nthe function is defined, and that that same "pre-computed" value is\nused for each call. This is especially important to understand when a\ndefault parameter is a mutable object, such as a list or a dictionary:\nif the function modifies the object (e.g. by appending an item to a\nlist), the default value is in effect modified. This is generally not\nwhat was intended. A way around this is to use ``None`` as the\ndefault, and explicitly test for it in the body of the function, e.g.:\n\n def whats_on_the_telly(penguin=None):\n if penguin is None:\n penguin = []\n penguin.append("property of the zoo")\n return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values. If the form\n"``*identifier``" is present, it is initialized to a tuple receiving\nany excess positional parameters, defaulting to the empty tuple. If\nthe form "``**identifier``" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions. This uses lambda forms,\ndescribed in section *Lambdas*. Note that the lambda form is merely a\nshorthand for a simplified function definition; a function defined in\na "``def``" statement can be passed around or assigned to another name\njust like a function defined by a lambda form. The "``def``" form is\nactually more powerful since it allows the execution of multiple\nstatements.\n\n**Programmer\'s note:** Functions are first-class objects. A "``def``"\nform executed inside a function definition defines a local function\nthat can be returned or passed around. Free variables used in the\nnested function can access the local variables of the function\ncontaining the def. See section *Naming and binding* for details.\n\n\nClass definitions\n=================\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n classdef ::= "class" classname [inheritance] ":" suite\n inheritance ::= "(" [expression_list] ")"\n classname ::= identifier\n\nA class definition is an executable statement. It first evaluates the\ninheritance list, if present. Each item in the inheritance list\nshould evaluate to a class object or class type which allows\nsubclassing. The class\'s suite is then executed in a new execution\nframe (see section *Naming and binding*), using a newly created local\nnamespace and the original global namespace. (Usually, the suite\ncontains only function definitions.) When the class\'s suite finishes\nexecution, its execution frame is discarded but its local namespace is\nsaved. [4] A class object is then created using the inheritance list\nfor the base classes and the saved local namespace for the attribute\ndictionary. The class name is bound to this class object in the\noriginal local namespace.\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass variables; they are shared by all instances. To create instance\nvariables, they can be set in a method with ``self.name = value``.\nBoth class and instance variables are accessible through the notation\n"``self.name``", and an instance variable hides a class variable with\nthe same name when accessed in this way. Class variables can be used\nas defaults for instance variables, but using mutable values there can\nlead to unexpected results. For *new-style class*es, descriptors can\nbe used to create instance variables with different implementation\ndetails.\n\nClass definitions, like function definitions, may be wrapped by one or\nmore *decorator* expressions. The evaluation rules for the decorator\nexpressions are the same as for functions. The result must be a class\nobject, which is then bound to the class name.\n\n-[ Footnotes ]-\n\n[1] The exception is propagated to the invocation stack only if there\n is no ``finally`` clause that negates the exception.\n\n[2] Currently, control "flows off the end" except in the case of an\n exception or the execution of a ``return``, ``continue``, or\n ``break`` statement.\n\n[3] A string literal appearing as the first statement in the function\n body is transformed into the function\'s ``__doc__`` attribute and\n therefore the function\'s *docstring*.\n\n[4] A string literal appearing as the first statement in the class\n body is transformed into the namespace\'s ``__doc__`` item and\n therefore the class\'s *docstring*.\n',
27 'customization': u'\nBasic customization\n*******************\n\nobject.__new__(cls[, ...])\n\n Called to create a new instance of class *cls*. ``__new__()`` is a\n static method (special-cased so you need not declare it as such)\n that takes the class of which an instance was requested as its\n first argument. The remaining arguments are those passed to the\n object constructor expression (the call to the class). The return\n value of ``__new__()`` should be the new object instance (usually\n an instance of *cls*).\n\n Typical implementations create a new instance of the class by\n invoking the superclass\'s ``__new__()`` method using\n ``super(currentclass, cls).__new__(cls[, ...])`` with appropriate\n arguments and then modifying the newly-created instance as\n necessary before returning it.\n\n If ``__new__()`` returns an instance of *cls*, then the new\n instance\'s ``__init__()`` method will be invoked like\n ``__init__(self[, ...])``, where *self* is the new instance and the\n remaining arguments are the same as were passed to ``__new__()``.\n\n If ``__new__()`` does not return an instance of *cls*, then the new\n instance\'s ``__init__()`` method will not be invoked.\n\n ``__new__()`` is intended mainly to allow subclasses of immutable\n types (like int, str, or tuple) to customize instance creation. It\n is also commonly overridden in custom metaclasses in order to\n customize class creation.\n\nobject.__init__(self[, ...])\n\n Called when the instance is created. The arguments are those\n passed to the class constructor expression. If a base class has an\n ``__init__()`` method, the derived class\'s ``__init__()`` method,\n if any, must explicitly call it to ensure proper initialization of\n the base class part of the instance; for example:\n ``BaseClass.__init__(self, [args...])``. As a special constraint\n on constructors, no value may be returned; doing so will cause a\n ``TypeError`` to be raised at runtime.\n\nobject.__del__(self)\n\n Called when the instance is about to be destroyed. This is also\n called a destructor. If a base class has a ``__del__()`` method,\n the derived class\'s ``__del__()`` method, if any, must explicitly\n call it to ensure proper deletion of the base class part of the\n instance. Note that it is possible (though not recommended!) for\n the ``__del__()`` method to postpone destruction of the instance by\n creating a new reference to it. It may then be called at a later\n time when this new reference is deleted. It is not guaranteed that\n ``__del__()`` methods are called for objects that still exist when\n the interpreter exits.\n\n Note: ``del x`` doesn\'t directly call ``x.__del__()`` --- the former\n decrements the reference count for ``x`` by one, and the latter\n is only called when ``x``\'s reference count reaches zero. Some\n common situations that may prevent the reference count of an\n object from going to zero include: circular references between\n objects (e.g., a doubly-linked list or a tree data structure with\n parent and child pointers); a reference to the object on the\n stack frame of a function that caught an exception (the traceback\n stored in ``sys.exc_traceback`` keeps the stack frame alive); or\n a reference to the object on the stack frame that raised an\n unhandled exception in interactive mode (the traceback stored in\n ``sys.last_traceback`` keeps the stack frame alive). The first\n situation can only be remedied by explicitly breaking the cycles;\n the latter two situations can be resolved by storing ``None`` in\n ``sys.exc_traceback`` or ``sys.last_traceback``. Circular\n references which are garbage are detected when the option cycle\n detector is enabled (it\'s on by default), but can only be cleaned\n up if there are no Python-level ``__del__()`` methods involved.\n Refer to the documentation for the ``gc`` module for more\n information about how ``__del__()`` methods are handled by the\n cycle detector, particularly the description of the ``garbage``\n value.\n\n Warning: Due to the precarious circumstances under which ``__del__()``\n methods are invoked, exceptions that occur during their execution\n are ignored, and a warning is printed to ``sys.stderr`` instead.\n Also, when ``__del__()`` is invoked in response to a module being\n deleted (e.g., when execution of the program is done), other\n globals referenced by the ``__del__()`` method may already have\n been deleted or in the process of being torn down (e.g. the\n import machinery shutting down). For this reason, ``__del__()``\n methods should do the absolute minimum needed to maintain\n external invariants. Starting with version 1.5, Python\n guarantees that globals whose name begins with a single\n underscore are deleted from their module before other globals are\n deleted; if no other references to such globals exist, this may\n help in assuring that imported modules are still available at the\n time when the ``__del__()`` method is called.\n\nobject.__repr__(self)\n\n Called by the ``repr()`` built-in function and by string\n conversions (reverse quotes) to compute the "official" string\n representation of an object. If at all possible, this should look\n like a valid Python expression that could be used to recreate an\n object with the same value (given an appropriate environment). If\n this is not possible, a string of the form ``<...some useful\n description...>`` should be returned. The return value must be a\n string object. If a class defines ``__repr__()`` but not\n ``__str__()``, then ``__repr__()`` is also used when an "informal"\n string representation of instances of that class is required.\n\n This is typically used for debugging, so it is important that the\n representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n Called by the ``str()`` built-in function and by the ``print``\n statement to compute the "informal" string representation of an\n object. This differs from ``__repr__()`` in that it does not have\n to be a valid Python expression: a more convenient or concise\n representation may be used instead. The return value must be a\n string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n New in version 2.1.\n\n These are the so-called "rich comparison" methods, and are called\n for comparison operators in preference to ``__cmp__()`` below. The\n correspondence between operator symbols and method names is as\n follows: ``x<y`` calls ``x.__lt__(y)``, ``x<=y`` calls\n ``x.__le__(y)``, ``x==y`` calls ``x.__eq__(y)``, ``x!=y`` and\n ``x<>y`` call ``x.__ne__(y)``, ``x>y`` calls ``x.__gt__(y)``, and\n ``x>=y`` calls ``x.__ge__(y)``.\n\n A rich comparison method may return the singleton\n ``NotImplemented`` if it does not implement the operation for a\n given pair of arguments. By convention, ``False`` and ``True`` are\n returned for a successful comparison. However, these methods can\n return any value, so if the comparison operator is used in a\n Boolean context (e.g., in the condition of an ``if`` statement),\n Python will call ``bool()`` on the value to determine if the result\n is true or false.\n\n There are no implied relationships among the comparison operators.\n The truth of ``x==y`` does not imply that ``x!=y`` is false.\n Accordingly, when defining ``__eq__()``, one should also define\n ``__ne__()`` so that the operators will behave as expected. See\n the paragraph on ``__hash__()`` for some important notes on\n creating *hashable* objects which support custom comparison\n operations and are usable as dictionary keys.\n\n There are no swapped-argument versions of these methods (to be used\n when the left argument does not support the operation but the right\n argument does); rather, ``__lt__()`` and ``__gt__()`` are each\n other\'s reflection, ``__le__()`` and ``__ge__()`` are each other\'s\n reflection, and ``__eq__()`` and ``__ne__()`` are their own\n reflection.\n\n Arguments to rich comparison methods are never coerced.\n\n To automatically generate ordering operations from a single root\n operation, see ``functools.total_ordering()``.\n\nobject.__cmp__(self, other)\n\n Called by comparison operations if rich comparison (see above) is\n not defined. Should return a negative integer if ``self < other``,\n zero if ``self == other``, a positive integer if ``self > other``.\n If no ``__cmp__()``, ``__eq__()`` or ``__ne__()`` operation is\n defined, class instances are compared by object identity\n ("address"). See also the description of ``__hash__()`` for some\n important notes on creating *hashable* objects which support custom\n comparison operations and are usable as dictionary keys. (Note: the\n restriction that exceptions are not propagated by ``__cmp__()`` has\n been removed since Python 1.5.)\n\nobject.__rcmp__(self, other)\n\n Changed in version 2.1: No longer supported.\n\nobject.__hash__(self)\n\n Called by built-in function ``hash()`` and for operations on\n members of hashed collections including ``set``, ``frozenset``, and\n ``dict``. ``__hash__()`` should return an integer. The only\n required property is that objects which compare equal have the same\n hash value; it is advised to somehow mix together (e.g. using\n exclusive or) the hash values for the components of the object that\n also play a part in comparison of objects.\n\n If a class does not define a ``__cmp__()`` or ``__eq__()`` method\n it should not define a ``__hash__()`` operation either; if it\n defines ``__cmp__()`` or ``__eq__()`` but not ``__hash__()``, its\n instances will not be usable in hashed collections. If a class\n defines mutable objects and implements a ``__cmp__()`` or\n ``__eq__()`` method, it should not implement ``__hash__()``, since\n hashable collection implementations require that a object\'s hash\n value is immutable (if the object\'s hash value changes, it will be\n in the wrong hash bucket).\n\n User-defined classes have ``__cmp__()`` and ``__hash__()`` methods\n by default; with them, all objects compare unequal (except with\n themselves) and ``x.__hash__()`` returns ``id(x)``.\n\n Classes which inherit a ``__hash__()`` method from a parent class\n but change the meaning of ``__cmp__()`` or ``__eq__()`` such that\n the hash value returned is no longer appropriate (e.g. by switching\n to a value-based concept of equality instead of the default\n identity based equality) can explicitly flag themselves as being\n unhashable by setting ``__hash__ = None`` in the class definition.\n Doing so means that not only will instances of the class raise an\n appropriate ``TypeError`` when a program attempts to retrieve their\n hash value, but they will also be correctly identified as\n unhashable when checking ``isinstance(obj, collections.Hashable)``\n (unlike classes which define their own ``__hash__()`` to explicitly\n raise ``TypeError``).\n\n Changed in version 2.5: ``__hash__()`` may now also return a long\n integer object; the 32-bit integer is then derived from the hash of\n that object.\n\n Changed in version 2.6: ``__hash__`` may now be set to ``None`` to\n explicitly flag instances of a class as unhashable.\n\nobject.__nonzero__(self)\n\n Called to implement truth value testing and the built-in operation\n ``bool()``; should return ``False`` or ``True``, or their integer\n equivalents ``0`` or ``1``. When this method is not defined,\n ``__len__()`` is called, if it is defined, and the object is\n considered true if its result is nonzero. If a class defines\n neither ``__len__()`` nor ``__nonzero__()``, all its instances are\n considered true.\n\nobject.__unicode__(self)\n\n Called to implement ``unicode()`` built-in; should return a Unicode\n object. When this method is not defined, string conversion is\n attempted, and the result of string conversion is converted to\n Unicode using the system default encoding.\n',
31 'dynamic-features': u'\nInteraction with dynamic features\n*********************************\n\nThere are several cases where Python statements are illegal when used\nin conjunction with nested scopes that contain free variables.\n\nIf a variable is referenced in an enclosing scope, it is illegal to\ndelete the name. An error will be reported at compile time.\n\nIf the wild card form of import --- ``import *`` --- is used in a\nfunction and the function contains or is a nested block with free\nvariables, the compiler will raise a ``SyntaxError``.\n\nIf ``exec`` is used in a function and the function contains or is a\nnested block with free variables, the compiler will raise a\n``SyntaxError`` unless the exec explicitly specifies the local\nnamespace for the ``exec``. (In other words, ``exec obj`` would be\nillegal, but ``exec obj in ns`` would be legal.)\n\nThe ``eval()``, ``execfile()``, and ``input()`` functions and the\n``exec`` statement do not have access to the full environment for\nresolving names. Names may be resolved in the local and global\nnamespaces of the caller. Free variables are not resolved in the\nnearest enclosing namespace, but in the global namespace. [1] The\n``exec`` statement and the ``eval()`` and ``execfile()`` functions\nhave optional arguments to override the global and local namespace.\nIf only one namespace is specified, it is used for both.\n',
33 'exceptions': u'\nExceptions\n**********\n\nExceptions are a means of breaking out of the normal flow of control\nof a code block in order to handle errors or other exceptional\nconditions. An exception is *raised* at the point where the error is\ndetected; it may be *handled* by the surrounding code block or by any\ncode block that directly or indirectly invoked the code block where\nthe error occurred.\n\nThe Python interpreter raises an exception when it detects a run-time\nerror (such as division by zero). A Python program can also\nexplicitly raise an exception with the ``raise`` statement. Exception\nhandlers are specified with the ``try`` ... ``except`` statement. The\n``finally`` clause of such a statement can be used to specify cleanup\ncode which does not handle the exception, but is executed whether an\nexception occurred or not in the preceding code.\n\nPython uses the "termination" model of error handling: an exception\nhandler can find out what happened and continue execution at an outer\nlevel, but it cannot repair the cause of the error and retry the\nfailing operation (except by re-entering the offending piece of code\nfrom the top).\n\nWhen an exception is not handled at all, the interpreter terminates\nexecution of the program, or returns to its interactive main loop. In\neither case, it prints a stack backtrace, except when the exception is\n``SystemExit``.\n\nExceptions are identified by class instances. The ``except`` clause\nis selected depending on the class of the instance: it must reference\nthe class of the instance or a base class thereof. The instance can\nbe received by the handler and can carry additional information about\nthe exceptional condition.\n\nExceptions can also be identified by strings, in which case the\n``except`` clause is selected by object identity. An arbitrary value\ncan be raised along with the identifying string which can be passed to\nthe handler.\n\nNote: Messages to exceptions are not part of the Python API. Their\n contents may change from one version of Python to the next without\n warning and should not be relied on by code which will run under\n multiple versions of the interpreter.\n\nSee also the description of the ``try`` statement in section *The try\nstatement* and ``raise`` statement in section *The raise statement*.\n\n-[ Footnotes ]-\n\n[1] This limitation occurs because the code that is executed by these\n operations is not available at the time the module is compiled.\n',
35 'execmodel': u'\nExecution model\n***************\n\n\nNaming and binding\n==================\n\n*Names* refer to objects. Names are introduced by name binding\noperations. Each occurrence of a name in the program text refers to\nthe *binding* of that name established in the innermost function block\ncontaining the use.\n\nA *block* is a piece of Python program text that is executed as a\nunit. The following are blocks: a module, a function body, and a class\ndefinition. Each command typed interactively is a block. A script\nfile (a file given as standard input to the interpreter or specified\non the interpreter command line the first argument) is a code block.\nA script command (a command specified on the interpreter command line\nwith the \'**-c**\' option) is a code block. The file read by the\nbuilt-in function ``execfile()`` is a code block. The string argument\npassed to the built-in function ``eval()`` and to the ``exec``\nstatement is a code block. The expression read and evaluated by the\nbuilt-in function ``input()`` is a code block.\n\nA code block is executed in an *execution frame*. A frame contains\nsome administrative information (used for debugging) and determines\nwhere and how execution continues after the code block\'s execution has\ncompleted.\n\nA *scope* defines the visibility of a name within a block. If a local\nvariable is defined in a block, its scope includes that block. If the\ndefinition occurs in a function block, the scope extends to any blocks\ncontained within the defining one, unless a contained block introduces\na different binding for the name. The scope of names defined in a\nclass block is limited to the class block; it does not extend to the\ncode blocks of methods -- this includes generator expressions since\nthey are implemented using a function scope. This means that the\nfollowing will fail:\n\n class A:\n a = 42\n b = list(a + i for i in range(10))\n\nWhen a name is used in a code block, it is resolved using the nearest\nenclosing scope. The set of all such scopes visible to a code block\nis called the block\'s *environment*.\n\nIf a name is bound in a block, it is a local variable of that block.\nIf a name is bound at the module level, it is a global variable. (The\nvariables of the module code block are local and global.) If a\nvariable is used in a code block but not defined there, it is a *free\nvariable*.\n\nWhen a name is not found at all, a ``NameError`` exception is raised.\nIf the name refers to a local variable that has not been bound, a\n``UnboundLocalError`` exception is raised. ``UnboundLocalError`` is a\nsubclass of ``NameError``.\n\nThe following constructs bind names: formal parameters to functions,\n``import`` statements, class and function definitions (these bind the\nclass or function name in the defining block), and targets that are\nidentifiers if occurring in an assignment, ``for`` loop header, in the\nsecond position of an ``except`` clause header or after ``as`` in a\n``with`` statement. The ``import`` statement of the form ``from ...\nimport *`` binds all names defined in the imported module, except\nthose beginning with an underscore. This form may only be used at the\nmodule level.\n\nA target occurring in a ``del`` statement is also considered bound for\nthis purpose (though the actual semantics are to unbind the name). It\nis illegal to unbind a name that is referenced by an enclosing scope;\nthe compiler will report a ``SyntaxError``.\n\nEach assignment or import statement occurs within a block defined by a\nclass or function definition or at the module level (the top-level\ncode block).\n\nIf a name binding operation occurs anywhere within a code block, all\nuses of the name within the block are treated as references to the\ncurrent block. This can lead to errors when a name is used within a\nblock before it is bound. This rule is subtle. Python lacks\ndeclarations and allows name binding operations to occur anywhere\nwithin a code block. The local variables of a code block can be\ndetermined by scanning the entire text of the block for name binding\noperations.\n\nIf the global statement occurs within a block, all uses of the name\nspecified in the statement refer to the binding of that name in the\ntop-level namespace. Names are resolved in the top-level namespace by\nsearching the global namespace, i.e. the namespace of the module\ncontaining the code block, and the builtins namespace, the namespace\nof the module ``__builtin__``. The global namespace is searched\nfirst. If the name is not found there, the builtins namespace is\nsearched. The global statement must precede all uses of the name.\n\nThe builtins namespace associated with the execution of a code block\nis actually found by looking up the name ``__builtins__`` in its\nglobal namespace; this should be a dictionary or a module (in the\nlatter case the module\'s dictionary is used). By default, when in the\n``__main__`` module, ``__builtins__`` is the built-in module\n``__builtin__`` (note: no \'s\'); when in any other module,\n``__builtins__`` is an alias for the dictionary of the ``__builtin__``\nmodule itself. ``__builtins__`` can be set to a user-created\ndictionary to create a weak form of restricted execution.\n\n**CPython implementation detail:** Users should not touch\n``__builtins__``; it is strictly an implementation detail. Users\nwanting to override values in the builtins namespace should ``import``\nthe ``__builtin__`` (no \'s\') module and modify its attributes\nappropriately.\n\nThe namespace for a module is automatically created the first time a\nmodule is imported. The main module for a script is always called\n``__main__``.\n\nThe ``global`` statement has the same scope as a name binding\noperation in the same block. If the nearest enclosing scope for a\nfree variable contains a global statement, the free variable is\ntreated as a global.\n\nA class definition is an executable statement that may use and define\nnames. These references follow the normal rules for name resolution.\nThe namespace of the class definition becomes the attribute dictionary\nof the class. Names defined at the class scope are not visible in\nmethods.\n\n\nInteraction with dynamic features\n---------------------------------\n\nThere are several cases where Python statements are illegal when used\nin conjunction with nested scopes that contain free variables.\n\nIf a variable is referenced in an enclosing scope, it is illegal to\ndelete the name. An error will be reported at compile time.\n\nIf the wild card form of import --- ``import *`` --- is used in a\nfunction and the function contains or is a nested block with free\nvariables, the compiler will raise a ``SyntaxError``.\n\nIf ``exec`` is used in a function and the function contains or is a\nnested block with free variables, the compiler will raise a\n``SyntaxError`` unless the exec explicitly specifies the local\nnamespace for the ``exec``. (In other words, ``exec obj`` would be\nillegal, but ``exec obj in ns`` would be legal.)\n\nThe ``eval()``, ``execfile()``, and ``input()`` functions and the\n``exec`` statement do not have access to the full environment for\nresolving names. Names may be resolved in the local and global\nnamespaces of the caller. Free variables are not resolved in the\nnearest enclosing namespace, but in the global namespace. [1] The\n``exec`` statement and the ``eval()`` and ``execfile()`` functions\nhave optional arguments to override the global and local namespace.\nIf only one namespace is specified, it is used for both.\n\n\nExceptions\n==========\n\nExceptions are a means of breaking out of the normal flow of control\nof a code block in order to handle errors or other exceptional\nconditions. An exception is *raised* at the point where th
68 'string-methods': u'\\nString Methods\\n**************\\n\\nBelow are listed the string methods which both 8-bit strings and\\nUnicode objects support. Some of them are also available on\\n``bytearray`` objects.\\n\\nIn addition, Python\\'s strings support the sequence type methods\\ndescribed in the *Sequence Types --- str, unicode, list, tuple,\\nbytearray, buffer, xrange* section. To output formatted strings use\\ntemplate strings or the ``%`` operator described in the *String\\nFormatting Operations* section. Also, see the ``re`` module for string\\nfunctions based on regular expressions.\\n\\nstr.capitalize()\\n\\n Return a copy of the string with its first character capitalized\\n and the rest lowercased.\\n\\n For 8-bit strings, this method is locale-dependent.\\n\\nstr.center(width[, fillchar])\\n\\n Return centered in a string of length *width*. Padding is done\\n using the specified *fillchar* (default is a space).\\n\\n Changed in version 2.4: Support for the *fillchar* argument.\\n\\nstr.count(sub[, start[, end]])\\n\\n Return the number of non-overlapping occurrences of substring *sub*\\n in the range [*start*, *end*]. Optional arguments *start* and\\n *end* are interpreted as in slice notation.\\n\\nstr.decode([encoding[, errors]])\\n\\n Decodes the string using the codec registered for *encoding*.\\n *encoding* defaults to the default string encoding. *errors* may\\n be given to set a different error handling scheme. The default is\\n ``\\'strict\\'``, meaning that encoding errors raise ``UnicodeError``.\\n Other possible values are ``\\'ignore\\'``, ``\\'replace\\'`` and any other\\n name registered via ``codecs.register_error()``, see section *Codec\\n Base Classes*.\\n\\n New in version 2.2.\\n\\n Changed in version 2.3: Support for other error handling schemes\\n added.\\n\\n Changed in version 2.7: Support for keyword arguments added.\\n\\nstr.encode([encoding[, errors]])\\n\\n Return an encoded version of the string. Default encoding is the\\n current default string encoding. *errors* may be given to set a\\n different error handling scheme. The default for *errors* is\\n ``\\'strict\\'``, meaning that encoding errors raise a\\n ``UnicodeError``. Other possible values are ``\\'ignore\\'``,\\n ``\\'replace\\'``, ``\\'xmlcharrefreplace\\'``, ``\\'backslashreplace\\'`` and\\n any other name registered via ``codecs.register_error()``, see\\n section *Codec Base Classes*. For a list of possible encodings, see\\n section *Standard Encodings*.\\n\\n New in version 2.0.\\n\\n Changed in version 2.3: Support for ``\\'xmlcharrefreplace\\'`` and\\n ``\\'backslashreplace\\'`` and other error handling schemes added.\\n\\n Changed in version 2.7: Support for keyword arguments added.\\n\\nstr.endswith(suffix[, start[, end]])\\n\\n Return ``True`` if the string ends with the specified *suffix*,\\n otherwise return ``False``. *suffix* can also be a tuple of\\n suffixes to look for. With optional *start*, test beginning at\\n that position. With optional *end*, stop comparing at that\\n position.\\n\\n Changed in version 2.5: Accept tuples as *suffix*.\\n\\nstr.expandtabs([tabsize])\\n\\n Return a copy of the string where all tab characters are replaced\\n by one or more spaces, depending on the current column and the\\n given tab size. The column number is reset to zero after each\\n newline occurring in the string. If *tabsize* is not given, a tab\\n size of ``8`` characters is assumed. This doesn\\'t understand other\\n non-printing characters or escape sequences.\\n\\nstr.find(sub[, start[, end]])\\n\\n Return the lowest index in the string where substring *sub* is\\n found, such that *sub* is contained in the slice ``s[start:end]``.\\n Optional arguments *start* and *end* are interpreted as in slice\\n notation. Return ``-1`` if *sub* is not found.\\n\\n Note: The ``find()`` method should be used only if you need to know the\\n position of *sub*. To check if *sub* is a substring or not, use\\n the ``in`` operator:\\n\\n >>> \\'Py\\' in \\'Python\\'\\n True\\n\\nstr.format(*args, **kwargs)\\n\\n Perform a string formatting operation. The string on which this\\n method is called can contain literal text or replacement fields\\n delimited by braces ``{}``. Each replacement field contains either\\n the numeric index of a positional argument, or the name of a\\n keyword argument. Returns a copy of the string where each\\n replacement field is replaced with the string value of the\\n corresponding argument.\\n\\n >>> "The sum of 1 + 2 is {0}".format(1+2)\\n \\'The sum of 1 + 2 is 3\\'\\n\\n See *Format String Syntax* for a description of the various\\n formatting options that can be specified in format strings.\\n\\n This method of string formatting is the new standard in Python 3.0,\\n and should be preferred to the ``%`` formatting described in\\n *String Formatting Operations* in new code.\\n\\n New in version 2.6.\\n\\nstr.index(sub[, start[, end]])\\n\\n Like ``find()``, but raise ``ValueError`` when the substring is not\\n found.\\n\\nstr.isalnum()\\n\\n Return true if all characters in the string are alphanumeric and\\n there is at least one character, false otherwise.\\n\\n For 8-bit strings, this method is locale-dependent.\\n\\nstr.isalpha()\\n\\n Return true if all characters in the string are alphabetic and\\n there is at least one character, false otherwise.\\n\\n For 8-bit strings, this method is locale-dependent.\\n\\nstr.isdigit()\\n\\n Return true if all characters in the string are digits and there is\\n at least one character, false otherwise.\\n\\n For 8-bit strings, this method is locale-dependent.\\n\\nstr.islower()\\n\\n Return true if all cased characters in the string are lowercase and\\n there is at least one cased character, false otherwise.\\n\\n For 8-bit strings, this method is locale-dependent.\\n\\nstr.isspace()\\n\\n Return true if there are only whitespace characters in the string\\n and there is at least one character, false otherwise.\\n\\n For 8-bit strings, this method is locale-dependent.\\n\\nstr.istitle()\\n\\n Return true if the string is a titlecased string and there is at\\n least one character, for example uppercase characters may only\\n follow uncased characters and lowercase characters only cased ones.\\n Return false otherwise.\\n\\n For 8-bit strings, this method is locale-dependent.\\n\\nstr.isupper()\\n\\n Return true if all cased characters in the string are uppercase and\\n there is at least one cased character, false otherwise.\\n\\n For 8-bit strings, this method is locale-dependent.\\n\\nstr.join(iterable)\\n\\n Return a string which is the concatenation of the strings in the\\n *iterable* *iterable*. The separator between elements is the\\n string providing this method.\\n\\nstr.ljust(width[, fillchar])\\n\\n Return the string left justified in a string of length *width*.\\n Padding is done using the specified *fillchar* (default is a\\n space). The original string is returned if *width* is less than\\n ``len(s)``.\\n\\n Changed in version 2.4: Support for the *fillchar* argument.\\n\\nstr.lower()\\n\\n Return a copy of the string converted to lowercase.\\n\\n For 8-bit strings, this method is locale-dependent.\\n\\nstr.lstrip([chars])\\n\\n Return a copy of the string with leading characters removed. The\\n *chars* argument is a string specifying the set of characters to be\\n removed. If omitted or ``None``, the *chars* argument defaults to\\n removing whitespace. The *chars* argument is not a prefix; rather,\\n all combinations of its values are stripped:\\n\\n >>> \\' spacious \\'.lstrip()\\n \\'spacious \\'\\n >>> \\'www.example.com\\'.lstrip(\\'cmowz.\\')\\n \\'example.com\\'\\n\\n Changed in version 2.2.2: Support for the *chars* argument.\\n\\nstr.partition(sep)\\n\\n Split the string at the first occurrence of *sep*, and return a\\n 3-tuple containing the part before the separator, the separator\\n itself, and the part after the separator. If the separator is not\\n found, return a 3-tuple containing the string itself, followed by\\n two empty strings.\\n\\n New in version 2.5.\\n\\nstr.replace(old, new[, count])\\n\\n Return a copy of the string with all occurrences of substring *old*\\n replaced by *new*. If the optional argument *count* is given, only\\n the first *count* occurrences are replaced.\\n\\nstr.rfind(sub[, start[, end]])\\n\\n Return the highest index in the string where substring *sub* is\\n found, such that *sub* is contained within ``s[start:end]``.\\n Optional arguments *start* and *end* are interpreted as in slice\\n notation. Return ``-1`` on failure.\\n\\nstr.rindex(sub[, start[, end]])\\n\\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\\n is not found.\\n\\nstr.rjust(width[, fillchar])\\n\\n Return the string right justified in a string of length *width*.\\n Padding is done using the specified *fillchar* (default is a\\n space). The original string is returned if *width* is less than\\n ``len(s)``.\\n\\n Changed in version 2.4: Support for the *fillchar* argument.\\n\\nstr.rpartition(sep)\\n\\n Split the string at the last occurrence of *sep*, and return a\\n 3-tuple containing the part before the separator, the separator\\n itself, and the part after the separator. If the separator is not\\n found, return a 3-tuple containing two empty strings, followed by\\n the string itself.\\n\\n New in version 2.5.\\n\\nstr.rsplit([sep[, maxsplit]])\\n\\n Return a list of the words in the string, using *sep* as the\\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\\n are done, the *rightmost* ones. If *sep* is not specified or\\n ``None``, any whitespace string is a separator. Except for\\n splitting from the right, ``rsplit()`` behaves like ``split()``\\n which is described in detail below.\\n\\n New in version 2.4.\\n\\nstr.rstrip([chars])\\n\\n Return a copy of the string with trailing characters removed. The\\n *chars* argument is a string specifying the set of characters to be\\n removed. If omitted or ``None``, the *chars* argument defaults to\\n removing whitespace. The *chars* argument is not a suffix; rather,\\n all combinations of its values are stripped:\\n\\n >>> \\' spacious \\'.rstrip()\\n \\' spacious\\'\\n >>> \\'mississippi\\'.rstrip(\\'ipz\\')\\n \\'mississ\\'\\n\\n Changed in version 2.2.2: Support for the *chars* argument.\\n\\nstr.split([sep[, maxsplit]])\\n\\n Return a list of the words in the string, using *sep* as the\\n delimiter string. If *maxsplit* is given, at most *maxsplit*\\n splits are done (thus, the list will have at most ``maxsplit+1``\\n elements). If *maxsplit* is not specified, then there is no limit\\n on the number of splits (all possible splits are made).\\n\\n If *sep* is given, consecutive delimiters are not grouped together\\n and are deemed to delimit empty strings (for example,\\n ``\\'1,,2\\'.split(\\',\\')`` returns ``[\\'1\\', \\'\\', \\'2\\']``). The *sep*\\n argument may consist of multiple characters (for example,\\n ``\\'1<>2<>3\\'.split(\\'<>\\')`` returns ``[\\'1\\', \\'2\\', \\'3\\']``). Splitting\\n an empty string with a specified separator returns ``[\\'\\']``.\\n\\n If *sep* is not specified or is ``None``, a different splitting\\n algorithm is applied: runs of consecutive whitespace are regarded\\n as a single separator, and the result will contain no empty strings\\n at the start or end if the string has leading or trailing\\n whitespace. Consequently, splitting an empty string or a string\\n consisting of just whitespace with a ``None`` separator returns\\n ``[]``.\\n\\n For example, ``\\' 1 2 3 \\'.split()`` returns ``[\\'1\\', \\'2\\', \\'3\\']``,\\n and ``\\' 1 2 3 \\'.split(None, 1)`` returns ``[\\'1\\', \\'2 3 \\']``.\\n\\nstr.splitlines([keepends])\\n\\n Return a list of the lines in the string, breaking at line\\n boundaries. Line breaks are not included in the resulting list\\n unless *keepends* is given and true.\\n\\nstr.startswith(prefix[, start[, end]])\\n\\n Return ``True`` if string starts with the *prefix*, otherwise\\n return ``False``. *prefix* can also be a tuple of prefixes to look\\n for. With optional *start*, test string beginning at that\\n position. With optional *end*, stop comparing string at that\\n position.\\n\\n Changed in version 2.5: Accept tuples as *prefix*.\\n\\nstr.strip([chars])\\n\\n Return a copy of the string with the leading and trailing\\n characters removed. The *chars* argument is a string specifying the\\n set of characters to be removed. If omitted or ``None``, the\\n *chars* argument defaults to removing whitespace. The *chars*\\n argument is not a prefix or suffix; rather, all combinations of its\\n values are stripped:\\n\\n >>> \\' spacious \\'.strip()\\n \\'spacious\\'\\n >>> \\'www.example.com\\'.strip(\\'cmowz.\\')\\n \\'example\\'\\n\\n Changed in version 2.2.2: Support for the *chars* argument.\\n\\nstr.swapcase()\\n\\n Return a copy of the string with uppercase characters converted to\\n lowercase and vice versa.\\n\\n For 8-bit strings, this method is locale-dependent.\\n\\nstr.title()\\n\\n Return a titlecased version of the string where words start with an\\n uppercase character and the remaining characters are lowercase.\\n\\n The algorithm uses a simple language-independent definition of a\\n word as groups of consecutive letters. The definition works in\\n many contexts but it means that apostrophes in contractions and\\n possessives form word boundaries, which may not be the desired\\n result:\\n\\n >>> "they\\'re bill\\'s friends from the UK".title()\\n "They\\'Re Bill\\'S Friends From The Uk"\\n\\n A workaround for apostrophes can be constructed using regular\\n expressions:\\n\\n >>> import re\\n >>> def titlecase(s):\\n return re.sub(r"[A-Za-z]+(\\'[A-Za-z]+)?",\\n lambda mo: mo.group(0)[0].upper() +\\n mo.group(0)[1:].lower(),\\n s)\\n\\n >>> titlecase("they\\'re bill\\'s friends.")\\n "They\\'re Bill\\'s Friends."\\n\\n For 8-bit strings, this method is locale-dependent.\\n\\nstr.translate(table[, deletechars])\\n\\n Return a copy of the string where all characters occurring in the\\n optional argument *deletechars* are removed, and the remaining\\n characters have been mapped through the given translation table,\\n which must be a string of length 256.\\n\\n You can use the ``maketrans()`` helper function in the ``string``\\n module to create a translation table. For string objects, set the\\n *table* argument to ``None`` for translations that only delete\\n characters:\\n\\n >>> \\'read this short text\\'.translate(None, \\'aeiou\\')\\n \\'rd ths shrt txt\\'\\n\\n New in version 2.6: Support for a ``None`` *table* argument.\\n\\n For Unicode objects, the ``translate()`` method does not accept the\\n optional *deletechars* argument. Instead, it returns a copy of the\\n *s* where all characters have been mapped through the given\\n translation table which must be a mapping of Unicode ordinals to\\n Unicode ordinals, Unicode strings or ``None``. Unmapped characters\\n are left untouched. Characters mapped to ``None`` are deleted.\\n Note, a more flexible approach is to create a custom character\\n mapping codec using the ``codecs`` module (see ``encodings.cp1251``\\n for an example).\\n\\nstr.upper()\\n\\n Return a copy of the string converted to uppercase.\\n\\n For 8-bit strings, this method is locale-dependent.\\n\\nstr.zfill(width)\\n\\n Return the numeric string left filled with zeros in a string of\\n length *width*. A sign prefix is handled correctly. The original\\n string is returned if *width* is less than ``len(s)``.\\n\\n New in version 2.2.2.\\n\\nThe following methods are present only on unicode objects:\\n\\nunicode.isnumeric()\\n\\n Return ``True`` if there are only numeric characters in S,\\n ``False`` otherwise. Numeric characters include digit characters,\\n and all characters that have the Unicode numeric value property,\\n e.g. U+2155, VULGAR FRACTION ONE FIFTH.\\n\\nunicode.isdecimal()\\n\\n Return ``True`` if there are only decimal characters in S,\\n ``False`` otherwise. Decimal characters include digit characters,\\n and all characters that that can be used to form decimal-radix\\n numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO.\\n', namespace
78 'typesseq': u'\\nSequence Types --- ``str``, ``unicode``, ``list``, ``tuple``, ``bytearray``, ``buffer``, ``xrange``\\n***************************************************************************************************\\n\\nThere are seven sequence types: strings, Unicode strings, lists,\\ntuples, bytearrays, buffers, and xrange objects.\\n\\nFor other containers see the built in ``dict`` and ``set`` classes,\\nand the ``collections`` module.\\n\\nString literals are written in single or double quotes: ``\\'xyzzy\\'``,\\n``"frobozz"``. See *String literals* for more about string literals.\\nUnicode strings are much like strings, but are specified in the syntax\\nusing a preceding ``\\'u\\'`` character: ``u\\'abc\\'``, ``u"def"``. In\\naddition to the functionality described here, there are also string-\\nspecific methods described in the *String Methods* section. Lists are\\nconstructed with square brackets, separating items with commas: ``[a,\\nb, c]``. Tuples are constructed by the comma operator (not within\\nsquare brackets), with or without enclosing parentheses, but an empty\\ntuple must have the enclosing parentheses, such as ``a, b, c`` or\\n``()``. A single item tuple must have a trailing comma, such as\\n``(d,)``.\\n\\nBytearray objects are created with the built-in function\\n``bytearray()``.\\n\\nBuffer objects are not directly supported by Python syntax, but can be\\ncreated by calling the built-in function ``buffer()``. They don\\'t\\nsupport concatenation or repetition.\\n\\nObjects of type xrange are similar to buffers in that there is no\\nspecific syntax to create them, but they are created using the\\n``xrange()`` function. They don\\'t support slicing, concatenation or\\nrepetition, and using ``in``, ``not in``, ``min()`` or ``max()`` on\\nthem is inefficient.\\n\\nMost sequence types support the following operations. The ``in`` and\\n``not in`` operations have the same priorities as the comparison\\noperations. The ``+`` and ``*`` operations have the same priority as\\nthe corresponding numeric operations. [3] Additional methods are\\nprovided for *Mutable Sequence Types*.\\n\\nThis table lists the sequence operations sorted in ascending priority\\n(operations in the same box have the same priority). In the table,\\n*s* and *t* are sequences of the same type; *n*, *i* and *j* are\\nintegers:\\n\\n+--------------------+----------------------------------+------------+\\n| Operation | Result | Notes |\\n+====================+==================================+============+\\n| ``x in s`` | ``True`` if an item of *s* is | (1) |\\n| | equal to *x*, else ``False`` | |\\n+--------------------+----------------------------------+------------+\\n| ``x not in s`` | ``False`` if an item of *s* is | (1) |\\n| | equal to *x*, else ``True`` | |\\n+--------------------+----------------------------------+------------+\\n| ``s + t`` | the concatenation of *s* and *t* | (6) |\\n+--------------------+----------------------------------+------------+\\n| ``s * n, n * s`` | *n* shallow copies of *s* | (2) |\\n| | concatenated | |\\n+--------------------+----------------------------------+------------+\\n| ``s[i]`` | *i*\\'th item of *s*, origin 0 | (3) |\\n+--------------------+----------------------------------+------------+\\n| ``s[i:j]`` | slice of *s* from *i* to *j* | (3)(4) |\\n+--------------------+----------------------------------+------------+\\n| ``s[i:j:k]`` | slice of *s* from *i* to *j* | (3)(5) |\\n| | with step *k* | |\\n+--------------------+----------------------------------+------------+\\n| ``len(s)`` | length of *s* | |\\n+--------------------+----------------------------------+------------+\\n| ``min(s)`` | smallest item of *s* | |\\n+--------------------+----------------------------------+------------+\\n| ``max(s)`` | largest item of *s* | |\\n+--------------------+----------------------------------+------------+\\n| ``s.index(i)`` | index of the first occurence of | |\\n| | *i* in *s* | |\\n+--------------------+----------------------------------+------------+\\n| ``s.count(i)`` | total number of occurences of | |\\n| | *i* in *s* | |\\n+--------------------+----------------------------------+------------+\\n\\nSequence types also support comparisons. In particular, tuples and\\nlists are compared lexicographically by comparing corresponding\\nelements. This means that to compare equal, every element must compare\\nequal and the two sequences must be of the same type and have the same\\nlength. (For full details see *Comparisons* in the language\\nreference.)\\n\\nNotes:\\n\\n1. When *s* is a string or Unicode string object the ``in`` and ``not\\n in`` operations act like a substring test. In Python versions\\n before 2.3, *x* had to be a string of length 1. In Python 2.3 and\\n beyond, *x* may be a string of any length.\\n\\n2. Values of *n* less than ``0`` are treated as ``0`` (which yields an\\n empty sequence of the same type as *s*). Note also that the copies\\n are shallow; nested structures are not copied. This often haunts\\n new Python programmers; consider:\\n\\n >>> lists = [[]] * 3\\n >>> lists\\n [[], [], []]\\n >>> lists[0].append(3)\\n >>> lists\\n [[3], [3], [3]]\\n\\n What has happened is that ``[[]]`` is a one-element list containing\\n an empty list, so all three elements of ``[[]] * 3`` are (pointers\\n to) this single empty list. Modifying any of the elements of\\n ``lists`` modifies this single list. You can create a list of\\n different lists this way:\\n\\n >>> lists = [[] for i in range(3)]\\n >>> lists[0].append(3)\\n >>> lists[1].append(5)\\n >>> lists[2].append(7)\\n >>> lists\\n [[3], [5], [7]]\\n\\n3. If *i* or *j* is negative, the index is relative to the end of the\\n string: ``len(s) + i`` or ``len(s) + j`` is substituted. But note\\n that ``-0`` is still ``0``.\\n\\n4. The slice of *s* from *i* to *j* is defined as the sequence of\\n items with index *k* such that ``i <= k < j``. If *i* or *j* is\\n greater than ``len(s)``, use ``len(s)``. If *i* is omitted or\\n ``None``, use ``0``. If *j* is omitted or ``None``, use\\n ``len(s)``. If *i* is greater than or equal to *j*, the slice is\\n empty.\\n\\n5. The slice of *s* from *i* to *j* with step *k* is defined as the\\n sequence of items with index ``x = i + n*k`` such that ``0 <= n <\\n (j-i)/k``. In other words, the indices are ``i``, ``i+k``,\\n ``i+2*k``, ``i+3*k`` and so on, stopping when *j* is reached (but\\n never including *j*). If *i* or *j* is greater than ``len(s)``,\\n use ``len(s)``. If *i* or *j* are omitted or ``None``, they become\\n "end" values (which end depends on the sign of *k*). Note, *k*\\n cannot be zero. If *k* is ``None``, it is treated like ``1``.\\n\\n6. **CPython implementation detail:** If *s* and *t* are both strings,\\n some Python implementations such as CPython can usually perform an\\n in-place optimization for assignments of the form ``s = s + t`` or\\n ``s += t``. When applicable, this optimization makes quadratic\\n run-time much less likely. This optimization is both version and\\n implementation dependent. For performance sensitive code, it is\\n preferable to use the ``str.join()`` method which assures\\n consistent linear concatenation performance across versions and\\n implementations.\\n\\n Changed in version 2.4: Formerly, string concatenation never\\n occurred in-place.\\n\\n\\nString Methods\\n==============\\n\\nBelow are listed the string methods which both 8-bit strings and\\nUnicode objects support. Some of them are also available on\\n``bytearray`` objects.\\n\\nIn addition, Python\\'s strings support the sequence type methods\\ndescribed in the *Sequence Types --- str, unicode, list, tuple,\\nbytearray, buffer, xrange* section. To output formatted strings use\\ntemplate strings or the ``%`` operator described in the *String\\nFormatting Operations* section. Also, see the ``re`` module for string\\nfunctions based on regular expressions.\\n\\nstr.capitalize()\\n\\n Return a copy of the string with its first character capitalized\\n and the rest lowercased.\\n\\n For 8-bit strings, this method is locale-dependent.\\n\\nstr.center(width[, fillchar])\\n\\n Return centered in a string of length *width*. Padding is done\\n using the specified *fillchar* (default is a space).\\n\\n Changed in version 2.4: Support for the *fillchar* argument.\\n\\nstr.count(sub[, start[, end]])\\n\\n Return the number of non-overlapping occurrences of substring *sub*\\n in the range [*start*, *end*]. Optional arguments *start* and\\n *end* are interpreted as in slice notation.\\n\\nstr.decode([encoding[, errors]])\\n\\n Decodes the string using the codec registered for *encoding*.\\n *encoding* defaults to the default string encoding. *errors* may\\n be given to set a different error handling scheme. The default is\\n ``\\'strict\\'``, meaning that encoding errors raise ``UnicodeError``.\\n Other possible values are ``\\'ignore\\'``, ``\\'replace\\'`` and any other\\n name registered via ``codecs.register_error()``, see section *Codec\\n Base Classes*.\\n\\n New in version 2.2.\\n\\n Changed in version 2.3: Support for other error handling schemes\\n added.\\n\\n Changed in version 2.7: Support for keyword arguments added.\\n\\nstr.encode([encoding[, errors]])\\n\\n Return an encoded version of the string. Default encoding is the\\n current default string encoding. *errors* may be given to set a\\n different error handling scheme. The default for *errors* is\\n ``\\'strict\\'``, meaning that encoding errors raise a\\n ``UnicodeError``. Other possible values are ``\\'ignore\\'``,\\n ``\\'replace\\'``, ``\\'xmlcharrefreplace\\'``, ``\\'backslashreplace\\'`` and\\n any other name registered via ``codecs.register_error()``, see\\n section *Codec Base Classes*. For a list of possible encodings, see\\n section *Standard Encodings*.\\n\\n New in version 2.0.\\n\\n Changed in version 2.3: Support for ``\\'xmlcharrefreplace\\'`` and\\n ``\\'backslashreplace\\'`` and other error handling schemes added.\\n\\n Changed in version 2.7: Support for keyword arguments added.\\n\\nstr.endswith(suffix[, start[, end]])\\n\\n Return ``True`` if the string ends with the specified *suffix*,\\n otherwise return ``False``. *suffix* can also be a tuple of\\n suffixes to look for. With optional *start*, test beginning at\\n that position. With optional *end*, stop comparing at that\\n position.\\n\\n Changed in version 2.5: Accept tuples as *suffix*.\\n\\nstr.expandtabs([tabsize])\\n\\n Return a copy of the string where all tab characters are replaced\\n by one or more spaces, depending on the current column and the\\n given tab size. The column number is reset to zero after each\\n newline occurring in the string. If *tabsize* is not given, a tab\\n size of ``8`` characters is assumed. This doesn\\'t understand other\\n non-printing characters or escape sequences.\\n\\nstr.find(sub[, start[, end]])\\n\\n Return the lowest index in the string where substring *sub* is\\n found, such that *sub* is contained in the slice ``s[start:end]``.\\n Optional arguments *start* and *end* are interpreted as in slice\\n notation. Return ``-1`` if *sub* is not found.\\n\\n Note: The ``find()`` method should be used only if you need to know the\\n position of *sub*. To check if *sub* is a substring or not, use\\n the ``in`` operator:\\n\\n >>> \\'Py\\' in \\'Python\\'\\n True\\n\\nstr.format(*args, **kwargs)\\n\\n Perform a string formatting operation. The string on which this\\n method is called can contain literal text or replacement fields\\n delimited by braces ``{}``. Each replacement field contains either\\n the numeric index of a positional argument, or the name of a\\n keyword argument. Returns a copy of the string where each\\n replacement field is replaced with the string value of the\\n corresponding argument.\\n\\n >>> "The sum of 1 + 2 is {0}".format(1+2)\\n \\'The sum of 1 + 2 is 3\\'\\n\\n See *Format String Syntax* for a description of the various\\n formatting options that can be specified in format strings.\\n\\n This method of string formatting is the new standard in Python 3.0,\\n and should be preferred to the ``%`` formatting described in\\n *String Formatting Operations* in new code.\\n\\n New in version 2.6.\\n\\nstr.index(sub[, start[, end]])\\n\\n Like ``find()``, but raise ``ValueError`` when the substring is not\\n found.\\n\\nstr.isalnum()\\n\\n Return true if all characters in the string are alphanumeric and\\n there is at least one character, false otherwise.\\n\\n For 8-bit strings, this method is locale-dependent.\\n\\nstr.isalpha()\\n\\n Return true if all characters in the string are alphabetic and\\n there is at least one character, false otherwise.\\n\\n For 8-bit strings, this method is locale-dependent.\\n\\nstr.isdigit()\\n\\n Return true if all characters in the string are digits and there is\\n at least one character, false otherwise.\\n\\n For 8-bit strings, this method is locale-dependent.\\n\\nstr.islower()\\n\\n Return true if all cased characters in the string are lowercase and\\n there is at least one cased character, false otherwise.\\n\\n For 8-bit strings, this method is locale-dependent.\\n\\nstr.isspace()\\n\\n Return true if there are only whitespace characters in the string\\n and there is at least one character, false otherwise.\\n\\n For 8-bit strings, this method is locale-dependent.\\n\\nstr.istitle()\\n\\n Return true if the string is a titlecased string and there is at\\n least one character, for example uppercase characters may only\\n follow uncased characters and lowercase characters only cased ones.\\n Return false otherwise.\\n\\n For 8-bit strings, this method is locale-dependent.\\n\\nstr.isupper()\\n\\n Return true if all cased characters in the string are uppercase and\\n there is at least one cased character, false otherwise.\\n\\n For 8-bit strings, this method is locale-dependent.\\n\\nstr.join(iterable)\\n\\n Return a string which is the concatenation of the strings in the\\n *iterable* *iterable*. The separator between elements is the\\n string providing this method.\\n\\nstr.ljust(width[, fillchar])\\n\\n Return the string left justified in a string of length *width*.\\n Padding is done using the specified *fillchar* (default is a\\n space). The original string is returned if *width* is less than\\n ``len(s)``.\\n\\n Changed in version 2.4: Support for the *fillchar* argument.\\n\\nstr.lower()\\n\\n Return a copy of the string converted to lowercase.\\n\\n For 8-bit strings, this method is locale-dependent.\\n\\nstr.lstrip([chars])\\n\\n Return a copy of the string with leading characters removed. The\\n *chars* argument is a string specifying the set of characters to be\\n removed. If omitted or ``None``, the *chars* argument defaults to\\n removing whitespace. The *chars* argument is not a prefix; rather,\\n all combinations of its values are stripped:\\n\\n >>> \\' spacious \\'.lstrip()\\n \\'spacious \\'\\n >>> \\'www.example.com\\'.lstrip(\\'cmowz.\\')\\n \\'example.com\\'\\n\\n Changed in version 2.2.2: Support for the *chars* argument.\\n\\nstr.partition(sep)\\n\\n Split the string at the first occurrence of *sep*, and return a\\n 3-tuple containing the part before the separator, the separator\\n itself, and the part after the separator. If the separator is not\\n found, return a 3-tuple containing the string itself, followed by\\n two empty strings.\\n\\n New in version 2.5.\\n\\nstr.replace(old, new[, count])\\n\\n Return a copy of the string with all occurrences of substring *old*\\n replaced by *new*. If the optional argument *count* is given, only\\n the first *count* occurrences are replaced.\\n\\nstr.rfind(sub[, start[, end]])\\n\\n Return the highest index in the string where substring *sub* is\\n found, such that *sub* is contained within ``s[start:end]``.\\n Optional arguments *start* and *end* are interpreted as in slice\\n notation. Return ``-1`` on failure.\\n\\nstr.rindex(sub[, start[, end]])\\n\\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\\n is not found.\\n\\nstr.rjust(width[, fillchar])\\n\\n Return the string right justified in a string of length *width*.\\n Padding is done using the specified *fillchar* (default is a\\n space). The original string is returned if *width* is less than\\n ``len(s)``.\\n\\n Changed in version 2.4: Support for the *fillchar* argument.\\n\\nstr.rpartition(sep)\\n\\n Split the string at the last occurrence of *sep*, and return a\\n 3-tuple containing the part before the separator, the separator\\n itself, and the part after the separator. If the separator is not\\n found, return a 3-tuple containing two empty strings, followed by\\n the string itself.\\n\\n New in version 2.5.\\n\\nstr.rsplit([sep[, maxsplit]])\\n\\n Return a list of the words in the string, using *sep* as the\\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\\n are done, the *rightmost* ones. If *sep* is not specified or\\n ``None``, any whitespace string is a separator. Except for\\n splitting from the right, ``rsplit()`` behaves like ``split()``\\n which is described in detail below.\\n\\n New in version 2.4.\\n\\nstr.rstrip([chars])\\n\\n Return a copy of the string with trailing characters removed. The\\n *chars* argument is a string specifying the set of characters to be\\n removed. If omitted or ``None``, the *chars* argument defaults to\\n removing whitespace. The *chars* argument is not a suffix; rather,\\n all combinations of its values are stripped:\\n\\n >>> \\' spacious \\'.rstrip()\\n \\' spacious\\'\\n >>> \\'mississippi\\'.rstrip(\\'ipz\\')\\n \\'mississ\\'\\n\\n Changed in version 2.2.2: Support for the *chars* argument.\\n\\nstr.split([sep[, maxsplit]])\\n\\n Return a list of the words in the string, using *sep* as the\\n delimiter string. If *maxsplit* is given, at most *maxsplit*\\n splits are done (thus, the list will have at most ``maxsplit+1``\\n elements). If *maxsplit* is not specified, then there is no limit\\n on the number of splits (all possible splits are made).\\n\\n If *sep* is given, consecutive delimiters are not grouped together\\n and are deemed to delimit empty strings (for example,\\n ``\\'1,,2\\'.split(\\',\\')`` returns ``[\\'1\\', \\'\\', \\'2\\']``). The *sep*\\n argument may consist of multiple characters (for example,\\n ``\\'1<>2<>3\\'.split(\\'<>\\')`` returns ``[\\'1\\', \\'2\\', \\'3\\']``). Splitting\\n an empty string with a specified separator returns ``[\\'\\']``.\\n\\n If *sep* is not specified or is ``None``, a different splitting\\n algorithm is applied: runs of consecutive whitespace are regarded\\n as a single separator, and the result will contain no empty strings\\n at the start or end if the string has leading or trailing\\n whitespace. Consequently, splitting an empty string or a string\\n consisting of just whitespace with a ``None`` separator returns\\n ``[]``.\\n\\n For example, ``\\' 1 2 3 \\'.split()`` returns ``[\\'1\\', \\'2\\', \\'3\\']``,\\n and ``\\' 1 2 3 \\'.split(None, 1)`` returns ``[\\'1\\', \\'2 3 \\']``.\\n\\nstr.splitlines([keepends])\\n\\n Return a list of the lines in the string, breaking at line\\n boundaries. Line breaks are not included in the resulting list\\n unless *keepends* is given and true.\\n\\nstr.startswith(prefix[, start[, end]])\\n\\n Return ``True`` if string starts with the *prefix*, otherwise\\n return ``False``. *prefix* can also be a tuple of prefixes to look\\n for. With optional *start*, test string beginning at that\\n position. With optional *end*, stop comparing string at that\\n position.\\n\\n Changed in version 2.5: Accept tuples as *prefix*.\\n\\nstr.strip([chars])\\n\\n Return a copy of the string with the leading and trailing\\n characters removed. The *chars* argument is a string specifying the\\n set of characters to be removed. If omitted or ``None``, the\\n *chars* argument defaults to removing whitespace. The *chars*\\n argument is not a prefix or suffix; rather, all combinations of its\\n values are stripped:\\n\\n >>> \\' spacious \\'.strip()\\n \\'spacious\\'\\n >>> \\'www.example.com\\'.strip(\\'cmowz.\\')\\n \\'example\\'\\n\\n Changed in version 2.2.2: Support for the *chars* argument.\\n\\nstr.swapcase()\\n\\n Return a copy of the string with uppercase characters converted to\\n lowercase and vice versa.\\n\\n For 8-bit strings, this method is locale-dependent.\\n\\nstr.title()\\n\\n Return a titlecased version of the string where words start with an\\n uppercase character and the remaining characters are lowercase.\\n\\n The algorithm uses a simple language-independent definition of a\\n word as groups of consecutive letters. The definition works in\\n many contexts but it means that apostrophes in contractions and\\n possessives form word boundaries, which may not be the desired\\n result:\\n\\n >>> "they\\'re bill\\'s friends from the UK".title()\\n "They\\'Re Bill\\'S Friends From The Uk"\\n\\n A workaround for apostrophes can be constructed using regular\\n expressions:\\n\\n >>> import re\\n >>> def titlecase(s):\\n return re.sub(r"[A-Za-z]+(\\'[A-Za-z]+)?",\\n lambda mo: mo.group(0)[0].upper() +\\n mo.group(0)[1:].lower(),\\n s)\\n\\n >>> titlecase("they\\'re bill\\'s friends.")\\n "They\\'re Bill\\'s Friends."\\n\\n For 8-bit strings, this method is locale-dependent.\\n\\nstr.translate(table[, deletechars])\\n\\n Return a copy of the string where all characters occurring in the\\n optional argument *deletechars* are removed, and the remaining\\n characters have been mapped through the given translation table,\\n which must be a string of length 256.\\n\\n You can use the ``maketrans()`` helper function in the ``string``\\n module to create a translation table. For string objects, set the\\n *table* argument to ``None`` for translations that only delete\\n characters:\\n\\n >>> \\'read this short text\\'.translate(None, \\'aeiou\\')\\n \\'rd ths shrt txt\\'\\n\\n New in version 2.6: Support for a ``None`` *table* argument.\\n\\n For Unicode objects, the ``translate()`` method does not accept the\\n optional *deletechars* argument. Instead, it returns a copy of the\\n *s* where all characters have been mapped through the given\\n translation table which must be a mapping of Unicode ordinals to\\n Unicode ordinals, Unicode strings or ``None``. Unmapped characters\\n are left untouched. Characters mapped to ``None`` are deleted.\\n Note, a more flexible approach is to create a custom character\\n mapping codec using the ``codecs`` module (see ``encodings.cp1251``\\n for an example).\\n\\nstr.upper()\\n\\n Return a copy of the string converted to uppercase.\\n\\n For 8-bit strings, this method is locale-dependent.\\n\\nstr.zfill(width)\\n\\n Return the numeric string left filled with zeros in a string of\\n length *width*. A sign prefix is handled correctly. The original\\n string is returned if *width* is less than ``len(s)``.\\n\\n New in version 2.2.2.\\n\\nThe following methods are present only on unicode objects:\\n\\nunicode.isnumeric()\\n\\n Return ``True`` if there are only numeric characters in S,\\n ``False`` otherwise. Numeric characters include digit characters,\\n and all characters that have the Unicode numeric value property,\\n e.g. U+2155, VULGAR FRACTION ONE FIFTH.\\n\\nunicode.isdecimal()\\n\\n Return ``True`` if there are only decimal characters in S,\\n ``False`` otherwise. Decimal characters include digit characters,\\n and all characters that that can be used to form decimal-radix\\n numbers, e.g. U+0660, ARABIC-INDIC DIGIT ZERO.\\n\\n\\nString Formatting Operations\\n============================\\n\\nString and Unicode objects have one unique built-in operation: the\\n``%`` operator (modulo). This is also known as the string\\n*formatting* or *interpolation* operator. Given ``format % values``\\n(where *format* is a string or Unicode object), ``%`` conversion\\nspecifications in *format* are replaced with zero or more elements of\\n*values*. The effect is similar to the using ``sprintf()`` in the C\\nlanguage. If *format* is a Unicode object, or if any of the objects\\nbeing converted using the ``%s`` conversion are Unicode objects, the\\nresult will also be a Unicode object.\\n\\nIf *format* requires a single argument, *values* may be a single non-\\ntuple object. [4] Otherwise, *values* must be a tuple with exactly\\nthe number of items specified by the format string, or a single\\nmapping object (for example, a dictionary).\\n\\nA conversion specifier contains two or more characters and has the\\nfollowing components, which must occur in this order:\\n\\n1. The ``\\'%\\'`` character, which marks the start of the specifier.\\n\\n2. Mapping key (optional), consisting of a parenthesised sequence of\\n characters (for example, ``(somename)``).\\n\\n3. Conversion flags (optional), which affect the result of some\\n conversion types.\\n\\n4. Minimum field width (optional). If specified as an ``\\'*\\'``\\n (asterisk), the actual width is read from the next element of the\\n tuple in *values*, and the object to convert comes after the\\n minimum field width and optional precision.\\n\\n5. Precision (optional), given as a ``\\'.\\'`` (dot) followed by the\\n precision. If specified as ``\\'*\\'`` (an asterisk), the actual width\\n is read from the next element of the tuple in *values*, and the\\n value to convert comes after the precision.\\n\\n6. Length modifier (optional).\\n\\n7. Conversion type.\\n\\nWhen the right argument is a dictionary (or other mapping type), then\\nthe formats in the string *must* include a parenthesised mapping key\\ninto that dictionary inserted immediately after the ``\\'%\\'`` character.\\nThe mapping key selects the value to be formatted from the mapping.\\nFor example:\\n\\n>>> print \\'%(language)s has %(number)03d quote types.\\' % \\\\\\n... {"language": "Python", "number": 2}\\nPython has 002 quote types.\\n\\nIn this case no ``*`` specifiers may occur in a format (since they\\nrequire a sequential parameter list).\\n\\nThe conversion flag characters are:\\n\\n+-----------+-----------------------------------------------------------------------+\\n| Flag | Meaning |\\n+===========+=======================================================================+\\n| ``\\'#\\'`` | The value conversion will use the "alternate form" (where defined |\\n| | below). |\\n+-----------+-----------------------------------------------------------------------+\\n| ``\\'0\\'`` | The conversion will be zero padded for numeric values. |\\n+-----------+-----------------------------------------------------------------------+\\n| ``\\'-\\'`` | The converted value is left adjusted (overrides the ``\\'0\\'`` |\\n| | conversion if both are given). |\\n+-----------+-----------------------------------------------------------------------+\\n| ``\\' \\'`` | (a space) A blank should be left before a positive number (or empty |\\n| | string) produced by a signed conversion. |\\n+-----------+-----------------------------------------------------------------------+\\n| ``\\'+\\'`` | A sign character (``\\'+\\'`` or ``\\'-\\'``) will precede the conversion |\\n| | (overrides a "space" flag). |\\n+-----------+-----------------------------------------------------------------------+\\n\\nA length modifier (``h``, ``l``, or ``L``) may be present, but is\\nignored as it is not necessary for Python -- so e.g. ``%ld`` is\\nidentical to ``%d``.\\n\\nThe conversion types are:\\n\\n+--------------+-------------------------------------------------------+---------+\\n| Conversion | Meaning | Notes |\\n+==============+=======================================================+=========+\\n| ``\\'d\\'`` | Signed integer decimal. | |\\n+--------------+-------------------------------------------------------+---------+\\n| ``\\'i\\'`` | Signed integer decimal. | |\\n+--------------+-------------------------------------------------------+---------+\\n| ``\\'o\\'`` | Signed octal value. | (1) |\\n+--------------+-------------------------------------------------------+---------+\\n| ``\\'u\\'`` | Obsolete type -- it is identical to ``\\'d\\'``. | (7) |\\n+--------------+-------------------------------------------------------+---------+\\n| ``\\'x\\'`` | Signed hexadecimal (lowercase). | (2) |\\n+--------------+-------------------------------------------------------+---------+\\n| ``\\'X\\'`` | Signed hexadecimal (uppercase). | (2) |\\n+--------------+-------------------------------------------------------+---------+\\n| ``\\'e\\'`` | Floating point exponential format (lowercase). | (3) |\\n+--------------+-------------------------------------------------------+---------+\\n| ``\\'E\\'`` | Floating point exponential format (uppercase). | (3) |\\n+--------------+-------------------------------------------------------+---------+\\n| ``\\'f\\'`` | Floating point decimal format. | (3) |\\n+--------------+-------------------------------------------------------+---------+\\n| ``\\'F\\'`` | Floating point decimal format. | (3) |\\n+--------------+-------------------------------------------------------+---------+\\n| ``\\'g\\'`` | Floating point format. Uses lowercase exponential | (4) |\\n| | format if exponent is less than -4 or not less than | |\\n| | precision, decimal format otherwise. | |\\n+--------------+-------------------------------------------------------+---------+\\n| ``\\'G\\'`` | Floating point format. Uses uppercase exponential | (4) |\\n| | format if exponent is less than -4 or not less than | |\\n| | precision, decimal format otherwise. | |\\n+--------------+-------------------------------------------------------+---------+\\n| ``\\'c\\'`` | Single character (accepts integer or single character | |\\n| | string). | |\\n+--------------+-------------------------------------------------------+---------+\\n| ``\\'r\\'`` | String (converts any Python object using ``repr()``). | (5) |\\n+--------------+-------------------------------------------------------+---------+\\n| ``\\'s\\'`` | String (converts any Python object using ``str()``). | (6) |\\n+--------------+-------------------------------------------------------+---------+\\n| ``\\'%\\'`` | No argument is converted, results in a ``\\'%\\'`` | |\\n| | character in the result. | |\\n+--------------+-------------------------------------------------------+---------+\\n\\nNotes:\\n\\n1. The alternate form causes a leading zero (``\\'0\\'``) to be inserted\\n between left-hand padding and the formatting of the number if the\\n leading character of the result is not already a zero.\\n\\n2. The alternate form causes a leading ``\\'0x\\'`` or ``\\'0X\\'`` (depending\\n on whether the ``\\'x\\'`` or ``\\'X\\'`` format was used) to be inserted\\n between left-hand padding and the formatting of the number if the\\n leading character of the result is not already a zero.\\n\\n3. The alternate form causes the result to always contain a decimal\\n point, even if no digits follow it.\\n\\n The precision determines the number of digits after the decimal\\n point and defaults to 6.\\n\\n4. The alternate form causes the result to always contain a decimal\\n point, and trailing zeroes are not removed as they would otherwise\\n be.\\n\\n The precision determines the number of significant digits before\\n and after the decimal point and defaults to 6.\\n\\n5. The ``%r`` conversion was added in Python 2.0.\\n\\n The precision determines the maximal number of characters used.\\n\\n6. If the object or format provided is a ``unicode`` string, the\\n resulting string will also be ``unicode``.\\n\\n The precision determines the maximal number of characters used.\\n\\n7. See **PEP 237**.\\n\\nSince Python strings have an explicit length, ``%s`` conversions do\\nnot assume that ``\\'\\\\0\\'`` is the end of the string.\\n\\nChanged in version 2.7: ``%f`` conversions for numbers whose absolute\\nvalue is over 1e50 are no longer replaced by ``%g`` conversions.\\n\\nAdditional string operations are defined in standard modules\\n``string`` and ``re``.\\n\\n\\nXRange Type\\n===========\\n\\nThe ``xrange`` type is an immutable sequence which is commonly used\\nfor looping. The advantage of the ``xrange`` type is that an\\n``xrange`` object will always take the same amount of memory, no\\nmatter the size of the range it represents. There are no consistent\\nperformance advantages.\\n\\nXRange objects have very little behavior: they only support indexing,\\niteration, and the ``len()`` function.\\n\\n\\nMutable Sequence Types\\n======================\\n\\nList and ``bytearray`` objects support additional operations that\\nallow in-place modification of the object. Other mutable sequence\\ntypes (when added to the language) should also support these\\noperations. Strings and tuples are immutable sequence types: such\\nobjects cannot be modified once created. The following operations are\\ndefined on mutable sequence types (where *x* is an arbitrary object):\\n\\n+--------------------------------+----------------------------------+-----------------------+\\n| Operation | Result | Notes |\\n+================================+==================================+=======================+\\n| ``s[i] = x`` | item *i* of *s* is replaced by | |\\n| | *x* | |\\n+--------------------------------+----------------------------------+-----------------------+\\n| ``s[i:j] = t`` | slice of *s* from *i* to *j* is | |\\n| | replaced by the contents of the | |\\n| | iterable *t* | |\\n+--------------------------------+----------------------------------+-----------------------+\\n| ``del s[i:j]`` | same as ``s[i:j] = []`` | |\\n+--------------------------------+----------------------------------+-----------------------+\\n| ``s[i:j:k] = t`` | the elements of ``s[i:j:k]`` are | (1) |\\n| | replaced by those of *t* | |\\n+--------------------------------+----------------------------------+-----------------------+\\n| ``del s[i:j:k]`` | removes the elements of | |\\n| | ``s[i:j:k]`` from the list | |\\n+--------------------------------+----------------------------------+-----------------------+\\n| ``s.append(x)`` | same as ``s[len(s):len(s)] = | (2) |\\n| | [x]`` | |\\n+--------------------------------+----------------------------------+-----------------------+\\n| ``s.extend(x)`` | same as ``s[len(s):len(s)] = x`` | (3) |\\n+--------------------------------+----------------------------------+-----------------------+\\n| ``s.count(x)`` | return number of *i*\\'s for which | |\\n| | ``s[i] == x`` | |\\n+--------------------------------+----------------------------------+-----------------------+\\n| ``s.index(x[, i[, j]])`` | return smallest *k* such that | (4) |\\n| | ``s[k] == x`` and ``i <= k < j`` | |\\n+--------------------------------+----------------------------------+-----------------------+\\n| ``s.insert(i, x)`` | same as ``s[i:i] = [x]`` | (5) |\\n+--------------------------------+----------------------------------+-----------------------+\\n| ``s.pop([i])`` | same as ``x = s[i]; del s[i]; | (6) |\\n| | return x`` | |\\n+--------------------------------+----------------------------------+-----------------------+\\n| ``s.remove(x)`` | same as ``del s[s.index(x)]`` | (4) |\\n+--------------------------------+----------------------------------+-----------------------+\\n| ``s.reverse()`` | reverses the items of *s* in | (7) |\\n| | place | |\\n+--------------------------------+----------------------------------+-----------------------+\\n| ``s.sort([cmp[, key[, | sort the items of *s* in place | (7)(8)(9)(10) |\\n| reverse]]])`` | | |\\n+--------------------------------+----------------------------------+-----------------------+\\n\\nNotes:\\n\\n1. *t* must have the same length as the slice it is replacing.\\n\\n2. The C implementation of Python has historically accepted multiple\\n parameters and implicitly joined them into a tuple; this no longer\\n works in Python 2.0. Use of this misfeature has been deprecated\\n since Python 1.4.\\n\\n3. *x* can be any iterable object.\\n\\n4. Raises ``ValueError`` when *x* is not found in *s*. When a negative\\n index is passed as the second or third parameter to the ``index()``\\n method, the list length is added, as for slice indices. If it is\\n still negative, it is truncated to zero, as for slice indices.\\n\\n Changed in version 2.3: Previously, ``index()`` didn\\'t have\\n arguments for specifying start and stop positions.\\n\\n5. When a negative index is passed as the first parameter to the\\n ``insert()`` method, the list length is added, as for slice\\n indices. If it is still negative, it is truncated to zero, as for\\n slice indices.\\n\\n Changed in version 2.3: Previously, all negative indices were\\n truncated to zero.\\n\\n6. The ``pop()`` method is only supported by the list and array types.\\n The optional argument *i* defaults to ``-1``, so that by default\\n the last item is removed and returned.\\n\\n7. The ``sort()`` and ``reverse()`` methods modify the list in place\\n for economy of space when sorting or reversing a large list. To\\n remind you that they operate by side effect, they don\\'t return the\\n sorted or reversed list.\\n\\n8. The ``sort()`` method takes optional arguments for controlling the\\n comparisons.\\n\\n *cmp* specifies a custom comparison function of two arguments (list\\n items) which should return a negative, zero or positive number\\n depending on whether the first argument is considered smaller than,\\n equal to, or larger than the second argument: ``cmp=lambda x,y:\\n cmp(x.lower(), y.lower())``. The default value is ``None``.\\n\\n *key* specifies a function of one argument that is used to extract\\n a comparison key from each list element: ``key=str.lower``. The\\n default value is ``None``.\\n\\n *reverse* is a boolean value. If set to ``True``, then the list\\n elements are sorted as if each comparison were reversed.\\n\\n In general, the *key* and *reverse* conversion processes are much\\n faster than specifying an equivalent *cmp* function. This is\\n because *cmp* is called multiple times for each list element while\\n *key* and *reverse* touch each element only once. Use\\n ``functools.cmp_to_key()`` to convert an old-style *cmp* function\\n to a *key* function.\\n\\n Changed in version 2.3: Support for ``None`` as an equivalent to\\n omitting *cmp* was added.\\n\\n Changed in version 2.4: Support for *key* and *reverse* was added.\\n\\n9. Starting with Python 2.3, the ``sort()`` method is guaranteed to be\\n stable. A sort is stable if it guarantees not to change the\\n relative order of elements that compare equal --- this is helpful\\n for sorting in multiple passes (for example, sort by department,\\n then by salary grade).\\n\\n10. **CPython implementation detail:** While a list is being sorted,\\n the effect of attempting to mutate, or even inspect, the list is\\n undefined. The C implementation of Python 2.3 and newer makes the\\n list appear empty for the duration, and raises ``ValueError`` if\\n it can detect that the list has been mutated during a sort.\\n', namespace
[all...]
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.2/Lib/test/
H A Dtest_py3kwarn.py394 def dumbo(where, names, args): pass

Completed in 897 milliseconds

12