Searched defs:set (Results 1 - 25 of 43) sorted by last modified time

12

/device/linaro/bootloader/edk2/AppPkg/Applications/Lua/src/
H A Dllex.c185 static int check_next (LexState *ls, const char *set) { argument
186 if (ls->current == '\0' || !strchr(set, ls->current))
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/PyMod-2.7.2/Modules/
H A D_sre.c440 SRE_CHARSET(SRE_CODE* set, SRE_CODE ch) argument
442 /* check if character is a member of the given set */
447 switch (*set++) {
454 if (ch == set[0])
456 set++;
461 if (sre_category(set[0], (int) ch))
463 set += 1;
469 if (ch < 256 && (set[ch >> 4] & (1 << (ch & 15))))
471 set += 16;
475 if (ch < 256 && (set[c
[all...]
H A Dselectmodule.c85 seq2set(PyObject *seq, fd_set *set, pylist fd2obj[FD_SETSIZE + 1]) argument
94 fd2obj[0].obj = (PyObject*)0; /* set list to zero size */
95 FD_ZERO(set);
125 FD_SET(v, set);
149 set2list(fd_set *set, pylist fd2obj[FD_SETSIZE + 1]) argument
156 if (FD_ISSET(fd2obj[j].fd, set))
166 if (FD_ISSET(fd, set)) {
262 * propagates the Python exception set in seq2set()
476 /* This will simply raise the KeyError set by PyDict_DelItem
490 Polls the set o
[all...]
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.10/Include/
H A Ddescrobject.h14 setter set; member in struct:PyGetSetDef
H A Dsetobject.h31 This data structure is shared by set and frozenset objects.
87 PyAPI_FUNC(int) PySet_Clear(PyObject *set); variable
89 PyAPI_FUNC(int) PySet_Discard(PyObject *set, PyObject *key);
90 PyAPI_FUNC(int) PySet_Add(PyObject *set, PyObject *key);
91 PyAPI_FUNC(int) _PySet_Next(PyObject *set, Py_ssize_t *pos, PyObject **key);
92 PyAPI_FUNC(int) _PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, long *hash);
93 PyAPI_FUNC(PyObject *) PySet_Pop(PyObject *set); variable
94 PyAPI_FUNC(int) _PySet_Update(PyObject *set, PyObject *iterable);
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.10/Lib/pydoc_data/
H A Dtopics.py4 'assignment': u'\nAssignment statements\n*********************\n\nAssignment statements are used to (re)bind names to values and to\nmodify attributes or items of mutable objects:\n\n assignment_stmt ::= (target_list "=")+ (expression_list | yield_expression)\n target_list ::= target ("," target)* [","]\n target ::= identifier\n | "(" target_list ")"\n | "[" target_list "]"\n | attributeref\n | subscription\n | slicing\n\n(See section Primaries for the syntax definitions for the last three\nsymbols.)\n\nAn assignment statement evaluates the expression list (remember that\nthis can be a single expression or a comma-separated list, the latter\nyielding a tuple) and assigns the single resulting object to each of\nthe target lists, from left to right.\n\nAssignment is defined recursively depending on the form of the target\n(list). When a target is part of a mutable object (an attribute\nreference, subscription or slicing), the mutable object must\nultimately perform the assignment and decide about its validity, and\nmay raise an exception if the assignment is unacceptable. The rules\nobserved by various types and the exceptions raised are given with the\ndefinition of the object types (see section The standard type\nhierarchy).\n\nAssignment of an object to a target list is recursively defined as\nfollows.\n\n* If the target list is a single target: The object is assigned to\n that target.\n\n* If the target list is a comma-separated list of targets: The\n object must be an iterable with the same number of items as there\n are targets in the target list, and the items are assigned, from\n left to right, to the corresponding targets.\n\nAssignment of an object to a single target is recursively defined as\nfollows.\n\n* If the target is an identifier (name):\n\n * If the name does not occur in a "global" statement in the\n current code block: the name is bound to the object in the current\n local namespace.\n\n * Otherwise: the name is bound to the object in the current global\n namespace.\n\n The name is rebound if it was already bound. This may cause the\n reference count for the object previously bound to the name to reach\n zero, causing the object to be deallocated and its destructor (if it\n has one) to be called.\n\n* If the target is a target list enclosed in parentheses or in\n square brackets: The object must be an iterable with the same number\n of items as there are targets in the target list, and its items are\n assigned, from left to right, to the corresponding targets.\n\n* If the target is an attribute reference: The primary expression in\n the reference is evaluated. It should yield an object with\n assignable attributes; if this is not the case, "TypeError" is\n raised. That object is then asked to assign the assigned object to\n the given attribute; if it cannot perform the assignment, it raises\n an exception (usually but not necessarily "AttributeError").\n\n Note: If the object is a class instance and the attribute reference\n occurs on both sides of the assignment operator, the RHS expression,\n "a.x" can access either an instance attribute or (if no instance\n attribute exists) a class attribute. The LHS target "a.x" is always\n set as an instance attribute, creating it if necessary. Thus, the\n two occurrences of "a.x" do not necessarily refer to the same\n attribute: if the RHS expression refers to a class attribute, the\n LHS creates a new instance attribute as the target of the\n assignment:\n\n class Cls:\n x = 3 # class variable\n inst = Cls()\n inst.x = inst.x + 1 # writes inst.x as 4 leaving Cls.x as 3\n\n This description does not necessarily apply to descriptor\n attributes, such as properties created with "property()".\n\n* If the target is a subscription: The primary expression in the\n reference is evaluated. It should yield either a mutable sequence\n object (such as a list) or a mapping object (such as a dictionary).\n Next, the subscript expression is evaluated.\n\n If the primary is a mutable sequence object (such as a list), the\n subscript must yield a plain integer. If it is negative, the\n sequence\'s length is added to it. The resulting value must be a\n nonnegative integer less than the sequence\'s length, and the\n sequence is asked to assign the assigned object to its item with\n that index. If the index is out of range, "IndexError" is raised\n (assignment to a subscripted sequence cannot add new items to a\n list).\n\n If the primary is a mapping object (such as a dictionary), the\n subscript must have a type compatible with the mapping\'s key type,\n and the mapping is then asked to create a key/datum pair which maps\n the subscript to the assigned object. This can either replace an\n existing key/value pair with the same key value, or insert a new\n key/value pair (if no key with the same value existed).\n\n* If the target is a slicing: The primary expression in the\n reference is evaluated. It should yield a mutable sequence object\n (such as a list). The assigned object should be a sequence object\n of the same type. Next, the lower and upper bound expressions are\n evaluated, insofar they are present; defaults are zero and the\n sequence\'s length. The bounds should evaluate to (small) integers.\n If either bound is negative, the sequence\'s length is added to it.\n The resulting bounds are clipped to lie between zero and the\n sequence\'s length, inclusive. Finally, the sequence object is asked\n to replace the slice with the items of the assigned sequence. The\n length of the slice may be different from the length of the assigned\n sequence, thus changing the length of the target sequence, if the\n object allows it.\n\n**CPython implementation detail:** In the current implementation, the\nsyntax for targets is taken to be the same as for expressions, and\ninvalid syntax is rejected during the code generation phase, causing\nless detailed error messages.\n\nWARNING: Although the definition of assignment implies that overlaps\nbetween the left-hand side and the right-hand side are \'safe\' (for\nexample "a, b = b, a" swaps two variables), overlaps *within* the\ncollection of assigned-to variables are not safe! For instance, the\nfollowing program prints "[0, 2]":\n\n x = [0, 1]\n i = 0\n i, x[i] = 1, 2\n print x\n\n\nAugmented assignment statements\n===============================\n\nAugmented assignment is the combination, in a single statement, of a\nbinary operation and an assignment statement:\n\n augmented_assignment_stmt ::= augtarget augop (expression_list | yield_expression)\n augtarget ::= identifier | attributeref | subscription | slicing\n augop ::= "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**="\n | ">>=" | "<<=" | "&=" | "^=" | "|="\n\n(See section Primaries for the syntax definitions for the last three\nsymbols.)\n\nAn augmented assignment evaluates the target (which, unlike normal\nassignment statements, cannot be an unpacking) and the expression\nlist, performs the binary operation specific to the type of assignment\non the two operands, and assigns the result to the original target.\nThe target is only evaluated once.\n\nAn augmented assignment expression like "x += 1" can be rewritten as\n"x = x + 1" to achieve a similar, but not exactly equal effect. In the\naugmented version, "x" is only evaluated once. Also, when possible,\nthe actual operation is performed *in-place*, meaning that rather than\ncreating a new object and assigning that to the target, the old object\nis modified instead.\n\nWith the exception of assigning to tuples and multiple targets in a\nsingle statement, the assignment done by augmented assignment\nstatements is handled the same way as normal assignments. Similarly,\nwith the exception of the possible *in-place* behavior, the binary\noperation performed by augmented assignment is the same as the normal\nbinary operations.\n\nFor targets which are attribute references, the same caveat about\nclass and instance attributes applies as for regular assignments.\n',
7 '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") for\nclass 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. This\n method should return the (computed) attribute value or raise an\n "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 for\n efficiency reasons and because otherwise "__getattr__()" would have\n no way to access other attributes of the instance. Note that at\n least for instance variables, you can fake total control by not\n 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 cause\n a recursive call to itself. Instead, it should insert the value in\n the dictionary of instance attributes, e.g., "self.__dict__[name] =\n value". For new-style classes, rather than accessing the instance\n dictionary, it should call the base class method with the same\n name, for example, "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 "__getattr__()",\n the latter will not be called unless "__getattribute__()" either\n calls it explicitly or raises an "AttributeError". This method\n should return the (computed) attribute value or raise an\n "AttributeError" exception. In order to avoid infinite recursion in\n this method, its implementation should always call the base class\n method with the same name to access any attributes it needs, for\n example, "object.__getattribute__(self, name)".\n\n Note: This method may still be bypassed when looking up special\n methods as the result of implicit invocation via language syntax\n or 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 "AttributeError"\n 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, it\nis 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 "type()").\n\nThe starting point for descriptor invocation is a binding, "a.x". How\nthe 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 "A"\n immediately preceding "B" and then invokes the descriptor with the\n 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__()". If it\ndoes not define "__get__()", then accessing the attribute will return\nthe descriptor object itself unless there is a value in the object\'s\ninstance dictionary. If the descriptor defines "__set__()" and/or\n"__delete__()", it is a data descriptor; if it defines neither, it is\na non-data descriptor. Normally, data descriptors define both\n"__get__()" and "__set__()", while non-data descriptors have just the\n"__get__()" method. Data descriptors with "__set__()" and "__get__()"\ndefined always override a redefinition in an instance dictionary. In\ncontrast, non-data descriptors can be overridden by instances.\n\nPython methods (including "staticmethod()" and "classmethod()") are\nimplemented 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\n defining *__slots__* do not support weak references to its\n instances. If weak reference support is needed, then add\n "\'__weakref__\'" to the sequence of strings in the *__slots__*\n 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 a\n 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\n instance variable defined by the base class slot is inaccessible\n (except by retrieving its descriptor directly from the base class).\n This 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 "tuple".\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings\n may 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',
20 'class': u'\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". Both\nclass 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 unless\n there is a "finally" clause which happens to raise another\n exception. That new exception causes the old one to be lost.\n\n[2] Currently, control "flows off the end" except in the case of\n an 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\n function body is transformed into the function\'s "__doc__"\n attribute and 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',
22 '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 control\nflow constructs. "try" specifies exception handlers and/or cleanup\ncode for a group of statements. Function and class definitions are\nalso 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 a\n"DEDENT". Also note that optional continuation clauses always begin\nwith 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 executed\nand the loop terminates.\n\nA "break" statement executed in the first suite terminates the loop\nwithout executing the "else" clause\'s suite. A "continue" statement\nexecuted in the first suite skips the rest of the suite and goes back\nto testing the expression.\n\n\nThe "for" statement\n===================\n\nThe "for" statement is used to iterate over the elements of a sequence\n(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" statement\nexecuted in the first suite skips the rest of the suite and continues\nwith the next item, or with the "else" clause if there was no next\nitem.\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\n loop (this can only occur for mutable sequences, i.e. lists). An\n internal counter is used to keep track of which item is used next,\n and this is incremented on each iteration. When this counter has\n reached the length of the sequence the loop terminates. This means\n that if the suite deletes the current (or a previous) item from the\n sequence, the next item will be skipped (since it gets the index of\n the 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" | ",") identifier]] ":" 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" had to be\nnested in "try"..."finally".\n\nThe "except" clause(s) specify one or more exception handlers. When no\nexception occurs in the "try" clause, no exception handler is\nexecuted. When an exception occurs in the "try" suite, a search for an\nexception handler is started. This search inspects the except clauses\nin turn until one is found that matches the exception. An expression-\nless except clause, if present, must be last; it matches any\nexception. For an except clause with an expression, that expression\nis evaluated, and the clause matches the exception if the resulting\nobject is "compatible" with the exception. An object is compatible\nwith an exception if it is the class or a base class of the exception\nobject, or a tuple containing an item compatible with the exception.\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 raised\nthe 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 are\nnot handled by the preceding "except" clauses.\n\nIf "finally" is present, it specifies a \'cleanup\' handler. The "try"\nclause is executed, including any "except" and "else" clauses. If an\nexception occurs in any of the clauses and is not handled, the\nexception is temporarily saved. The "finally" clause is executed. If\nthere is a saved exception, it is re-raised at the end of the\n"finally" clause. If the "finally" clause raises another exception or\nexecutes a "return" or "break" statement, the saved exception is\ndiscarded:\n\n >>> def f():\n ... try:\n ... 1/0\n ... finally:\n ... return 42\n ...\n >>> f()\n 42\n\nThe exception information is not available to the program during\nexecution of the "finally" clause.\n\nWhen a "return", "break" or "continue" statement is executed in the\n"try" suite of a "try"..."finally" statement, the "finally" clause is\nalso executed \'on the way out.\' A "continue" statement is illegal in\nthe "finally" clause. (The reason is a problem with the current\nimplementation --- this restriction may be lifted in the future).\n\nThe return value of a function is determined by the last "return"\nstatement executed. Since the "finally" clause always executes, a\n"return" statement executed in the "finally" clause will always be the\nlast one executed:\n\n >>> def foo():\n ... try:\n ... return \'try\'\n ... finally:\n ... return \'finally\'\n ...\n >>> foo()\n \'finally\'\n\nAdditional information on exceptions can be found in section\nExceptions, and information on using the "raise" statement to generate\nexceptions 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 "try"..."except"..."finally"\nusage patterns to be encapsulated for 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 be\n 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, three\n "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 reraised.\n If the return value was true, the exception is suppressed, and\n execution continues with the statement following the "with"\n 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 in\n Python 2.6.\n\nChanged in version 2.7: Support for multiple context expressions.\n\nSee also: **PEP 0343** - The "with" statement\n\n The specification, background, and examples for the Python "with"\n 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 the 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 Calls.\nA function call always assigns values to all parameters mentioned in\nthe parameter list, either from position arguments, from keyword\narguments, or from default values. If the form ""*identifier"" is\npresent, it is initialized to a tuple receiving any excess positional\nparameters, defaulting to the empty tuple. If the form\n""**identifier"" is present, it is initialized to a new dictionary\nreceiving any excess keyword arguments, defaulting to a new empty\ndictionary.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions. This uses lambda\nexpressions, described in section Lambdas. Note that the lambda\nexpression is merely a shorthand for a simplified function definition;\na function defined in a ""def"" statement can be passed around or\nassigned to another name just like a function defined by a lambda\nexpression. The ""def"" form is actually more powerful since it\nallows the execution of multiple statements.\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". Both\nclass 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 unless\n there is a "finally" clause which happens to raise another\n exception. That new exception causes the old one to be lost.\n\n[2] Currently, control "flows off the end" except in the case of\n an 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\n function body is transformed into the function\'s "__doc__"\n attribute and 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',
26 '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 an\n 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 after the instance has been created (by "__new__()"), but\n before it is returned to the caller. 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, if\n any, must explicitly call it to ensure proper initialization of the\n base class part of the instance; for example:\n "BaseClass.__init__(self, [args...])".\n\n Because "__new__()" and "__init__()" work together in constructing\n objects ("__new__()" to create it, and "__init__()" to customise\n it), no non-"None" value may be returned by "__init__()"; doing so\n will cause a "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, the\n derived class\'s "__del__()" method, if any, must explicitly call it\n to ensure proper deletion of the base class part of the instance.\n Note that it is possible (though not recommended!) for the\n "__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 is\n only called when "x"\'s reference count reaches zero. Some common\n situations that may prevent the reference count of an object from\n going to zero include: circular references between objects (e.g.,\n a doubly-linked list or a tree data structure with parent and\n child pointers); a reference to the object on the stack frame of\n a function that caught an exception (the traceback stored in\n "sys.exc_traceback" keeps the stack frame alive); or a reference\n to the object on the stack frame that raised an unhandled\n 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 references\n which are garbage are detected when the option cycle detector is\n enabled (it\'s on by default), but can only be cleaned up if there\n are no Python-level "__del__()" methods involved. Refer to the\n documentation for the "gc" module for more information about how\n "__del__()" methods are handled by the cycle detector,\n particularly the description of the "garbage" value.\n\n Warning: Due to the precarious circumstances under which\n "__del__()" methods are invoked, exceptions that occur during\n their execution are ignored, and a warning is printed to\n "sys.stderr" instead. Also, when "__del__()" is invoked in\n response to a module being deleted (e.g., when execution of the\n program is done), other globals referenced by the "__del__()"\n method may already have been deleted or in the process of being\n torn down (e.g. the import machinery shutting down). For this\n reason, "__del__()" methods should do the absolute minimum needed\n to maintain external invariants. Starting with version 1.5,\n Python 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\n See also the "-R" command-line option.\n\nobject.__repr__(self)\n\n Called by the "repr()" built-in function and by string conversions\n (reverse quotes) to compute the "official" string representation of\n an object. If at all possible, this should look like a valid\n Python expression that could be used to recreate an object with the\n same value (given an appropriate environment). If this is not\n possible, a string of the form "<...some useful description...>"\n should be returned. The return value must be a string object. If a\n class defines "__repr__()" but not "__str__()", then "__repr__()"\n is also used when an "informal" string representation of instances\n 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 to\n 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 "x.__le__(y)",\n "x==y" calls "x.__eq__(y)", "x!=y" and "x<>y" call "x.__ne__(y)",\n "x>y" calls "x.__gt__(y)", and "x>=y" calls "x.__ge__(y)".\n\n A rich comparison method may return the singleton "NotImplemented"\n if it does not implement the operation for a given pair of\n arguments. By convention, "False" and "True" are returned for a\n successful comparison. However, these methods can return any value,\n so if the comparison operator is used in a Boolean context (e.g.,\n in the condition of an "if" statement), Python will call "bool()"\n on the value to determine if the result 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 the\n paragraph on "__hash__()" for some important notes on creating\n *hashable* objects which support custom comparison operations and\n 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 other\'s\n reflection, "__le__()" and "__ge__()" are each other\'s reflection,\n and "__eq__()" and "__ne__()" are their own 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". If\n no "__cmp__()", "__eq__()" or "__ne__()" operation is defined,\n class instances are compared by object identity ("address"). See\n also the description of "__hash__()" for some important notes on\n creating *hashable* objects which support custom comparison\n 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 members\n of hashed collections including "set", "frozenset", and "dict".\n "__hash__()" should return an integer. The only required property\n is that objects which compare equal have the same hash value; it is\n advised to somehow mix together (e.g. using exclusive or) the hash\n values for the components of the object that also play a part in\n comparison of objects.\n\n If a class does not define a "__cmp__()" or "__eq__()" method it\n should not define a "__hash__()" operation either; if it defines\n "__cmp__()" or "__eq__()" but not "__hash__()", its instances will\n not be usable in hashed collections. If a class defines mutable\n objects and implements a "__cmp__()" or "__eq__()" method, it\n should not implement "__hash__()", since hashable collection\n implementations require that a object\'s hash value is immutable (if\n the object\'s hash value changes, it will be in the wrong hash\n bucket).\n\n User-defined classes have "__cmp__()" and "__hash__()" methods by\n default; with them, all objects compare unequal (except with\n themselves) and "x.__hash__()" returns a result derived from\n "id(x)".\n\n Classes which inherit a "__hash__()" method from a parent class but\n change the meaning of "__cmp__()" or "__eq__()" such that the hash\n value returned is no longer appropriate (e.g. by switching to a\n value-based concept of equality instead of the default identity\n based equality) can explicitly flag themselves as being unhashable\n by setting "__hash__ = None" in the class definition. Doing so\n 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',
27 'debugger': u'\n"pdb" --- The Python Debugger\n*****************************\n\n**Source code:** Lib/pdb.py\n\n======================================================================\n\nThe module "pdb" defines an interactive source code debugger for\nPython programs. It supports setting (conditional) breakpoints and\nsingle stepping at the source line level, inspection of stack frames,\nsource code listing, and evaluation of arbitrary Python code in the\ncontext of any stack frame. It also supports post-mortem debugging\nand can be called under program control.\n\nThe debugger is extensible --- it is actually defined as the class\n"Pdb". This is currently undocumented but easily understood by reading\nthe source. The extension interface uses the modules "bdb" and "cmd".\n\nThe debugger\'s prompt is "(Pdb)". Typical usage to run a program under\ncontrol of the debugger is:\n\n >>> import pdb\n >>> import mymodule\n >>> pdb.run(\'mymodule.test()\')\n > <string>(0)?()\n (Pdb) continue\n > <string>(1)?()\n (Pdb) continue\n NameError: \'spam\'\n > <string>(1)?()\n (Pdb)\n\n"pdb.py" can also be invoked as a script to debug other scripts. For\nexample:\n\n python -m pdb myscript.py\n\nWhen invoked as a script, pdb will automatically enter post-mortem\ndebugging if the program being debugged exits abnormally. After post-\nmortem debugging (or after normal exit of the program), pdb will\nrestart the program. Automatic restarting preserves pdb\'s state (such\nas breakpoints) and in most cases is more useful than quitting the\ndebugger upon program\'s exit.\n\nNew in version 2.4: Restarting post-mortem behavior added.\n\nThe typical usage to break into the debugger from a running program is\nto insert\n\n import pdb; pdb.set_trace()\n\nat the location you want to break into the debugger. You can then\nstep through the code following this statement, and continue running\nwithout the debugger using the "c" command.\n\nThe typical usage to inspect a crashed program is:\n\n >>> import pdb\n >>> import mymodule\n >>> mymodule.test()\n Traceback (most recent call last):\n File "<stdin>", line 1, in ?\n File "./mymodule.py", line 4, in test\n test2()\n File "./mymodule.py", line 3, in test2\n print spam\n NameError: spam\n >>> pdb.pm()\n > ./mymodule.py(3)test2()\n -> print spam\n (Pdb)\n\nThe module defines the following functions; each enters the debugger\nin a slightly different way:\n\npdb.run(statement[, globals[, locals]])\n\n Execute the *statement* (given as a string) under debugger control.\n The debugger prompt appears before any code is executed; you can\n set breakpoints and type "continue", or you can step through the\n statement using "step" or "next" (all these commands are explained\n below). The optional *globals* and *locals* arguments specify the\n environment in which the code is executed; by default the\n dictionary of the module "__main__" is used. (See the explanation\n of the "exec" statement or the "eval()" built-in function.)\n\npdb.runeval(expression[, globals[, locals]])\n\n Evaluate the *expression* (given as a string) under debugger\n control. When "runeval()" returns, it returns the value of the\n expression. Otherwise this function is similar to "run()".\n\npdb.runcall(function[, argument, ...])\n\n Call the *function* (a function or method object, not a string)\n with the given arguments. When "runcall()" returns, it returns\n whatever the function call returned. The debugger prompt appears\n as soon as the function is entered.\n\npdb.set_trace()\n\n Enter the debugger at the calling stack frame. This is useful to\n hard-code a breakpoint at a given point in a program, even if the\n code is not otherwise being debugged (e.g. when an assertion\n fails).\n\npdb.post_mortem([traceback])\n\n Enter post-mortem debugging of the given *traceback* object. If no\n *traceback* is given, it uses the one of the exception that is\n currently being handled (an exception must be being handled if the\n default is to be used).\n\npdb.pm()\n\n Enter post-mortem debugging of the traceback found in\n "sys.last_traceback".\n\nThe "run*" functions and "set_trace()" are aliases for instantiating\nthe "Pdb" class and calling the method of the same name. If you want\nto access further features, you have to do this yourself:\n\nclass class pdb.Pdb(completekey=\'tab\', stdin=None, stdout=None, skip=None)\n\n "Pdb" is the debugger class.\n\n The *completekey*, *stdin* and *stdout* arguments are passed to the\n underlying "cmd.Cmd" class; see the description there.\n\n The *skip* argument, if given, must be an iterable of glob-style\n module name patterns. The debugger will not step into frames that\n originate in a module that matches one of these patterns. [1]\n\n Example call to enable tracing with *skip*:\n\n import pdb; pdb.Pdb(skip=[\'django.*\']).set_trace()\n\n New in version 2.7: The *skip* argument.\n\n run(statement[, globals[, locals]])\n runeval(expression[, globals[, locals]])\n runcall(function[, argument, ...])\n set_trace()\n\n See the documentation for the functions explained above.\n',
29 'dict': u'\nDictionary displays\n*******************\n\nA dictionary display is a possibly empty series of key/datum pairs\nenclosed in curly braces:\n\n dict_display ::= "{" [key_datum_list | dict_comprehension] "}"\n key_datum_list ::= key_datum ("," key_datum)* [","]\n key_datum ::= expression ":" expression\n dict_comprehension ::= expression ":" expression comp_for\n\nA dictionary display yields a new dictionary object.\n\nIf a comma-separated sequence of key/datum pairs is given, they are\nevaluated from left to right to define the entries of the dictionary:\neach key object is used as a key into the dictionary to store the\ncorresponding datum. This means that you can specify the same key\nmultiple times in the key/datum list, and the final dictionary\'s value\nfor that key will be the last one given.\n\nA dict comprehension, in contrast to list and set comprehension
65 '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 "UnicodeError".\\n Other possible values are "\\'ignore\\'", "\\'replace\\'",\\n "\\'xmlcharrefreplace\\'", "\\'backslashreplace\\'" and any other name\\n registered via "codecs.register_error()", see section Codec Base\\n Classes. For a list of possible encodings, see section Standard\\n 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 suffixes\\n to look for. With optional *start*, test beginning at that\\n position. With optional *end*, stop comparing at that 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. Tab positions occur every *tabsize* characters\\n (default is 8, giving tab positions at columns 0, 8, 16 and so on).\\n To expand the string, the current column is set to zero and the\\n string is examined character by character. If the character is a\\n tab ("\\\\t"), one or more space characters are inserted in the result\\n until the current column is equal to the next tab position. (The\\n tab character itself is not copied.) If the character is a newline\\n ("\\\\n") or return ("\\\\r"), it is copied and the current column is\\n reset to zero. Any other character is copied unchanged and the\\n current column is incremented by one regardless of how the\\n character is represented when printed.\\n\\n >>> \\'01\\\\t012\\\\t0123\\\\t01234\\'.expandtabs()\\n \\'01 012 0123 01234\\'\\n >>> \\'01\\\\t012\\\\t0123\\\\t01234\\'.expandtabs(4)\\n \\'01 012 0123 01234\\'\\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\\n the position of *sub*. To check if *sub* is a substring or not,\\n use 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,\\n and should be preferred to the "%" formatting described in String\\n 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 [4] in the string are lowercase\\n and 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 [4] in the string are uppercase\\n and 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 or\\n equal to "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 with all the cased characters [4]\\n 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* is\\n 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 or\\n equal to "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 splitting\\n from the right, "rsplit()" behaves like "split()" which is\\n 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 or "-1", then there is\\n no limit 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* argument\\n may consist of multiple characters (for example,\\n "\\'1<>2<>3\\'.split(\\'<>\\')" returns "[\\'1\\', \\'2\\', \\'3\\']"). Splitting an\\n 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 For example, "\\' 1 2 3 \\'.split()" returns "[\\'1\\', \\'2\\', \\'3\\']", and\\n "\\' 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. This method uses the *universal newlines* approach to\\n splitting lines. Line breaks are not included in the resulting list\\n unless *keepends* is given and true.\\n\\n For example, "\\'ab c\\\\n\\\\nde fg\\\\rkl\\\\r\\\\n\\'.splitlines()" returns "[\\'ab\\n c\\', \\'\\', \\'de fg\\', \\'kl\\']", while the same call with\\n "splitlines(True)" returns "[\\'ab c\\\\n\\', \\'\\\\n\\', \\'de fg\\\\r\\', \\'kl\\\\r\\\\n\\']".\\n\\n Unlike "split()" when a delimiter string *sep* is given, this\\n method returns an empty list for the empty string, and a terminal\\n line break does not result in an extra line.\\n\\nstr.startswith(prefix[, start[, end]])\\n\\n Return "True" if string starts with the *prefix*, otherwise return\\n "False". *prefix* can also be a tuple of prefixes to look for.\\n With optional *start*, test string beginning at that position.\\n With optional *end*, stop comparing string at that 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 *chars*\\n argument defaults to removing whitespace. The *chars* argument is\\n not a prefix or suffix; rather, all combinations of its values are\\n 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. Note,\\n a more flexible approach is to create a custom character mapping\\n codec using the "codecs" module (see "encodings.cp1251" for an\\n example).\\n\\nstr.upper()\\n\\n Return a copy of the string with all the cased characters [4]\\n converted to uppercase. Note that "str.upper().isupper()" might be\\n "False" if "s" contains uncased characters or if the Unicode\\n category of the resulting character(s) is not "Lu" (Letter,\\n uppercase), but e.g. "Lt" (Letter, titlecase).\\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 or equal to "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, "False"\\n otherwise. Numeric characters include digit characters, and all\\n characters that have the Unicode numeric value property, e.g.\\n U+2155, VULGAR FRACTION ONE FIFTH.\\n\\nunicode.isdecimal()\\n\\n Return "True" if there are only decimal characters in S, "False"\\n otherwise. Decimal characters include digit characters, and all\\n characters that can be used to form decimal-radix numbers, e.g.\\n U+0660, ARABIC-INDIC DIGIT ZERO.\\n', namespace
75 '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, and\\nthe "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 addition to\\nthe functionality described here, there are also string-specific\\nmethods described in the String Methods section. Lists are constructed\\nwith square brackets, separating items with commas: "[a, b, c]".\\nTuples are constructed by the comma operator (not within square\\nbrackets), with or without enclosing parentheses, but an empty tuple\\nmust have the enclosing parentheses, such as "a, b, c" or "()". A\\nsingle item tuple must have a trailing comma, such as "(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 them is\\ninefficient.\\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 the\\ncorresponding numeric operations. [3] Additional methods are provided\\nfor Mutable Sequence Types.\\n\\nThis table lists the sequence operations sorted in ascending priority.\\nIn the table, *s* and *t* are sequences of the same type; *n*, *i* and\\n*j* are integers:\\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(x)" | index of the first occurrence of | |\\n| | *x* in *s* | |\\n+--------------------+----------------------------------+------------+\\n| "s.count(x)" | total number of occurrences of | |\\n| | *x* 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 reference.)\\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\\n the 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 "None",\\n use "0". If *j* is omitted or "None", use "len(s)". If *i* is\\n greater than or equal to *j*, the slice is 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", "i+2*k",\\n "i+3*k" and so on, stopping when *j* is reached (but never\\n including *j*). If *i* or *j* is greater than "len(s)", use\\n "len(s)". If *i* or *j* are omitted or "None", they become "end"\\n values (which end depends on the sign of *k*). Note, *k* cannot be\\n zero. If *k* is "None", it is treated like "1".\\n\\n6. **CPython implementation detail:** If *s* and *t* are both\\n strings, some Python implementations such as CPython can usually\\n perform an in-place optimization for assignments of the form "s = s\\n + t" or "s += t". When applicable, this optimization makes\\n quadratic run-time much less likely. This optimization is both\\n version and implementation dependent. For performance sensitive\\n code, it is 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 "UnicodeError".\\n Other possible values are "\\'ignore\\'", "\\'replace\\'",\\n "\\'xmlcharrefreplace\\'", "\\'backslashreplace\\'" and any other name\\n registered via "codecs.register_error()", see section Codec Base\\n Classes. For a list of possible encodings, see section Standard\\n 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 suffixes\\n to look for. With optional *start*, test beginning at that\\n position. With optional *end*, stop comparing at that 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. Tab positions occur every *tabsize* characters\\n (default is 8, giving tab positions at columns 0, 8, 16 and so on).\\n To expand the string, the current column is set to zero and the\\n string is examined character by character. If the character is a\\n tab ("\\\\t"), one or more space characters are inserted in the result\\n until the current column is equal to the next tab position. (The\\n tab character itself is not copied.) If the character is a newline\\n ("\\\\n") or return ("\\\\r"), it is copied and the current column is\\n reset to zero. Any other character is copied unchanged and the\\n current column is incremented by one regardless of how the\\n character is represented when printed.\\n\\n >>> \\'01\\\\t012\\\\t0123\\\\t01234\\'.expandtabs()\\n \\'01 012 0123 01234\\'\\n >>> \\'01\\\\t012\\\\t0123\\\\t01234\\'.expandtabs(4)\\n \\'01 012 0123 01234\\'\\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\\n the position of *sub*. To check if *sub* is a substring or not,\\n use 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,\\n and should be preferred to the "%" formatting described in String\\n 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 [4] in the string are lowercase\\n and 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 [4] in the string are uppercase\\n and 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 or\\n equal to "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 with all the cased characters [4]\\n 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* is\\n 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 or\\n equal to "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 splitting\\n from the right, "rsplit()" behaves like "split()" which is\\n 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 or "-1", then there is\\n no limit 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* argument\\n may consist of multiple characters (for example,\\n "\\'1<>2<>3\\'.split(\\'<>\\')" returns "[\\'1\\', \\'2\\', \\'3\\']"). Splitting an\\n 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 For example, "\\' 1 2 3 \\'.split()" returns "[\\'1\\', \\'2\\', \\'3\\']", and\\n "\\' 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. This method uses the *universal newlines* approach to\\n splitting lines. Line breaks are not included in the resulting list\\n unless *keepends* is given and true.\\n\\n For example, "\\'ab c\\\\n\\\\nde fg\\\\rkl\\\\r\\\\n\\'.splitlines()" returns "[\\'ab\\n c\\', \\'\\', \\'de fg\\', \\'kl\\']", while the same call with\\n "splitlines(True)" returns "[\\'ab c\\\\n\\', \\'\\\\n\\', \\'de fg\\\\r\\', \\'kl\\\\r\\\\n\\']".\\n\\n Unlike "split()" when a delimiter string *sep* is given, this\\n method returns an empty list for the empty string, and a terminal\\n line break does not result in an extra line.\\n\\nstr.startswith(prefix[, start[, end]])\\n\\n Return "True" if string starts with the *prefix*, otherwise return\\n "False". *prefix* can also be a tuple of prefixes to look for.\\n With optional *start*, test string beginning at that position.\\n With optional *end*, stop comparing string at that 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 *chars*\\n argument defaults to removing whitespace. The *chars* argument is\\n not a prefix or suffix; rather, all combinations of its values are\\n 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. Note,\\n a more flexible approach is to create a custom character mapping\\n codec using the "codecs" module (see "encodings.cp1251" for an\\n example).\\n\\nstr.upper()\\n\\n Return a copy of the string with all the cased characters [4]\\n converted to uppercase. Note that "str.upper().isupper()" might be\\n "False" if "s" contains uncased characters or if the Unicode\\n category of the resulting character(s) is not "Lu" (Letter,\\n uppercase), but e.g. "Lt" (Letter, titlecase).\\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 or equal to "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, "False"\\n otherwise. Numeric characters include digit characters, and all\\n characters that have the Unicode numeric value property, e.g.\\n U+2155, VULGAR FRACTION ONE FIFTH.\\n\\nunicode.isdecimal()\\n\\n Return "True" if there are only decimal characters in S, "False"\\n otherwise. Decimal characters include digit characters, and all\\n characters that can be used to form decimal-radix numbers, e.g.\\n U+0660, ARABIC-INDIC DIGIT ZERO.\\n\\n\\nString Formatting Operations\\n============================\\n\\nString and Unicode objects have one unique built-in operation: the "%"\\noperator (modulo). This is also known as the string *formatting* or\\n*interpolation* operator. Given "format % values" (where *format* is\\na string or Unicode object), "%" conversion specifications in *format*\\nare replaced with zero or more elements of *values*. The effect is\\nsimilar to the using "sprintf()" in the C language. If *format* is a\\nUnicode object, or if any of the objects being converted using the\\n"%s" conversion are Unicode objects, the result will also be a Unicode\\nobject.\\n\\nIf *format* requires a single argument, *values* may be a single non-\\ntuple object. [5] 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\\n of 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\\'" conversion |\\n| | 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 ignored as\\nit is not necessary for Python -- so e.g. "%ld" is identical 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 not\\nassume 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 "string"\\nand "re".\\n\\n\\nXRange Type\\n===========\\n\\nThe "xrange" type is an immutable sequence which is commonly used for\\nlooping. The advantage of the "xrange" type is that an "xrange"\\nobject will always take the same amount of memory, no matter the size\\nof the range it represents. There are no consistent performance\\nadvantages.\\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 allow\\nin-place modification of the object. Other mutable sequence types\\n(when added to the language) should also support these operations.\\nStrings and tuples are immutable sequence types: such objects cannot\\nbe modified once created. The following operations are defined on\\nmutable 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)] = [x]" | (2) |\\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\\n multiple parameters and implicitly joined them into a tuple; this\\n no longer works in Python 2.0. Use of this misfeature has been\\n deprecated 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\\n negative index is passed as the second or third parameter to the\\n "index()" method, the list length is added, as for slice indices.\\n If it is still negative, it is truncated to zero, as for slice\\n indices.\\n\\n Changed in version 2.3: Previously, "index()" didn\\'t have arguments\\n 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 indices.\\n If it is still negative, it is truncated to zero, as for slice\\n indices.\\n\\n Changed in version 2.3: Previously, all negative indices were\\n truncated to zero.\\n\\n6. The "pop()" method\\'s optional argument *i* defaults to "-1", so\\n that by default 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 to\\n 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\\n be 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\\n sorted, the effect of attempting to mutate, or even inspect, the\\n list is undefined. The C implementation of Python 2.3 and newer\\n makes the list appear empty for the duration, and raises\\n "ValueError" if it can detect that the list has been mutated\\n during a sort.\\n', namespace
[all...]
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.10/Lib/xml/dom/
H A Dminicompat.py104 def set(self, value, name=name): function in function:defproperty
109 prop = property(get, set, doc=doc)
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.10/Lib/xml/etree/
H A DElementTree.py182 # {@link #Element.set},
431 # @param key What attribute to set.
434 def set(self, key, value): member in class:Element
464 # elements may or may not be included. To get a stable set, use the
950 HTML_EMPTY = set(HTML_EMPTY)
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.10/Objects/
H A Ddescrobject.c199 if (descr->d_getset->set != NULL)
200 return descr->d_getset->set(obj, value,
1139 raise AttributeError, "can't set attribute"
1251 "can't set attribute");
1265 property_copy(PyObject *old, PyObject *get, PyObject *set, PyObject *del) argument
1278 if (set == NULL || set == Py_None) {
1279 Py_XDECREF(set);
1280 set = pold->prop_set ? pold->prop_set : Py_None;
1294 new = PyObject_CallFunction(type, "OOOO", get, set, de
1304 PyObject *get = NULL, *set = NULL, *del = NULL, *doc = NULL; local
[all...]
H A Dsetobject.c2 /* set object implementation
22 return; /* caller will expect error to be set anyway */
108 * set: start over.
141 * set: start over.
241 known to be absent from the set. This routine also assumes that
242 the set contains no deleted entries. Besides the performance benefit,
326 /* Make the set empty, using the new table. */
470 /* This is delicate. During the process of clearing the set,
471 * decrefs can cause the set to mutate. To avoid fatal confusion
472 * (voice of experience), we have to make the set empt
2284 PySet_Clear(PyObject *set) argument
2304 PySet_Discard(PyObject *set, PyObject *key) argument
2325 _PySet_Next(PyObject *set, Py_ssize_t *pos, PyObject **key) argument
2340 _PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, long *hash) argument
2356 PySet_Pop(PyObject *set) argument
2366 _PySet_Update(PyObject *set, PyObject *iterable) argument
[all...]
H A Dtypeobject.c62 - Py_TPFLAGS_VALID_VERSION_TAG is never set if
63 Py_TPFLAGS_HAVE_VERSION_TAG is not set (e.g. on type
66 - before Py_TPFLAGS_VALID_VERSION_TAG can be set on a type,
67 it must first be set on all super types.
71 tp_version_tag value is meaningless unless this flag is set.
144 /* Ensure that the tp_version_tag is valid and set
165 Values are also set to NULL for added protection, as they
232 "can't set %s.__name__", type->tp_name);
297 "can't set %s.__module__", type->tp_name);
330 /* __abstractmethods__ should only be set onc
1445 PyObject *set = PyDict_New(); local
[all...]
H A Dunicodeobject.c206 /* the linebreak mask is set up by Unicode_Init below */
243 Py_LOCAL_INLINE(int) unicode_member(Py_UNICODE chr, Py_UNICODE* set, Py_ssize_t setlen) argument
248 if (set[i] == chr)
254 #define BLOOM_MEMBER(mask, chr, set, setlen) \
255 BLOOM(mask, chr) && unicode_member(chr, set, setlen)
1616 * answer depends on whether we are encoding set O as itself, and also
1864 /* Characters not in the BASE64 set implicitly unshift the sequence
3918 * Decode MBCS string into unicode object. If 'final' is set, converts
3932 /* Skip trailing lead-byte unless 'final' is set */
6426 to the default encoding. errors may be given to set
[all...]
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.10/PyMod-2.7.10/Modules/
H A D_sre.c441 SRE_CHARSET(SRE_CODE* set, SRE_CODE ch) argument
443 /* check if character is a member of the given set */
448 switch (*set++) {
455 if (ch == set[0])
457 set++;
462 if (sre_category(set[0], (int) ch))
464 set += 1;
470 if (ch < 256 && (set[ch >> 4] & (1 << (ch & 15))))
472 set += 16;
476 if (ch < 256 && (set[c
[all...]
H A Dselectmodule.c95 seq2set(PyObject *seq, fd_set *set, pylist fd2obj[FD_SETSIZE + 1]) argument
103 fd2obj[0].obj = (PyObject*)0; /* set list to zero size */
104 FD_ZERO(set);
132 FD_SET(v, set);
156 set2list(fd_set *set, pylist fd2obj[FD_SETSIZE + 1]) argument
163 if (FD_ISSET(fd2obj[j].fd, set))
173 if (FD_ISSET(fd, set)) {
262 * propagates the Python exception set in seq2set()
498 /* This will simply raise the KeyError set by PyDict_DelItem
512 Polls the set o
[all...]
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.2/Include/
H A Ddescrobject.h14 setter set; member in struct:PyGetSetDef
H A Dsetobject.h31 This data structure is shared by set and frozenset objects.
87 PyAPI_FUNC(int) PySet_Clear(PyObject *set); variable
89 PyAPI_FUNC(int) PySet_Discard(PyObject *set, PyObject *key);
90 PyAPI_FUNC(int) PySet_Add(PyObject *set, PyObject *key);
91 PyAPI_FUNC(int) _PySet_Next(PyObject *set, Py_ssize_t *pos, PyObject **key);
92 PyAPI_FUNC(int) _PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, long *hash);
93 PyAPI_FUNC(PyObject *) PySet_Pop(PyObject *set); variable
94 PyAPI_FUNC(int) _PySet_Update(PyObject *set, PyObject *iterable);
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.2/Lib/
H A DConfigParser.py83 set(section, option, value)
84 set the given option
380 def set(self, section, option, value=None): member in class:RawConfigParser
512 # match if it would set optval to None
529 # a non-fatal parsing error occurred. set up the
572 seen = set()
726 def set(self, section, option, value=None): member in class:SafeConfigParser
727 """Set an option. Extend ConfigParser.set: check for string values."""
745 ConfigParser.set(self, section, option, value)
H A DCookie.py136 the value to a string, when the values are set dictionary-style.
375 # The _getdate() routine is used to set the expiration time in
452 def set(self, key, val, coded_val, member in class:Morsel
458 raise CookieError("Attempt to set a reserved key: %s" % key)
466 # end set
555 # A container class for a set of Morsels
585 M.set(key, real_value, coded_value)
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.2/Lib/pydoc_data/
H A Dtopics.py3 'assignment': u'\nAssignment statements\n*********************\n\nAssignment statements are used to (re)bind names to values and to\nmodify attributes or items of mutable objects:\n\n assignment_stmt ::= (target_list "=")+ (expression_list | yield_expression)\n target_list ::= target ("," target)* [","]\n target ::= identifier\n | "(" target_list ")"\n | "[" target_list "]"\n | attributeref\n | subscription\n | slicing\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn assignment statement evaluates the expression list (remember that\nthis can be a single expression or a comma-separated list, the latter\nyielding a tuple) and assigns the single resulting object to each of\nthe target lists, from left to right.\n\nAssignment is defined recursively depending on the form of the target\n(list). When a target is part of a mutable object (an attribute\nreference, subscription or slicing), the mutable object must\nultimately perform the assignment and decide about its validity, and\nmay raise an exception if the assignment is unacceptable. The rules\nobserved by various types and the exceptions raised are given with the\ndefinition of the object types (see section *The standard type\nhierarchy*).\n\nAssignment of an object to a target list is recursively defined as\nfollows.\n\n* If the target list is a single target: The object is assigned to\n that target.\n\n* If the target list is a comma-separated list of targets: The object\n must be an iterable with the same number of items as there are\n targets in the target list, and the items are assigned, from left to\n right, to the corresponding targets.\n\nAssignment of an object to a single target is recursively defined as\nfollows.\n\n* If the target is an identifier (name):\n\n * If the name does not occur in a ``global`` statement in the\n current code block: the name is bound to the object in the current\n local namespace.\n\n * Otherwise: the name is bound to the object in the current global\n namespace.\n\n The name is rebound if it was already bound. This may cause the\n reference count for the object previously bound to the name to reach\n zero, causing the object to be deallocated and its destructor (if it\n has one) to be called.\n\n* If the target is a target list enclosed in parentheses or in square\n brackets: The object must be an iterable with the same number of\n items as there are targets in the target list, and its items are\n assigned, from left to right, to the corresponding targets.\n\n* If the target is an attribute reference: The primary expression in\n the reference is evaluated. It should yield an object with\n assignable attributes; if this is not the case, ``TypeError`` is\n raised. That object is then asked to assign the assigned object to\n the given attribute; if it cannot perform the assignment, it raises\n an exception (usually but not necessarily ``AttributeError``).\n\n Note: If the object is a class instance and the attribute reference\n occurs on both sides of the assignment operator, the RHS expression,\n ``a.x`` can access either an instance attribute or (if no instance\n attribute exists) a class attribute. The LHS target ``a.x`` is\n always set as an instance attribute, creating it if necessary.\n Thus, the two occurrences of ``a.x`` do not necessarily refer to the\n same attribute: if the RHS expression refers to a class attribute,\n the LHS creates a new instance attribute as the target of the\n assignment:\n\n class Cls:\n x = 3 # class variable\n inst = Cls()\n inst.x = inst.x + 1 # writes inst.x as 4 leaving Cls.x as 3\n\n This description does not necessarily apply to descriptor\n attributes, such as properties created with ``property()``.\n\n* If the target is a subscription: The primary expression in the\n reference is evaluated. It should yield either a mutable sequence\n object (such as a list) or a mapping object (such as a dictionary).\n Next, the subscript expression is evaluated.\n\n If the primary is a mutable sequence object (such as a list), the\n subscript must yield a plain integer. If it is negative, the\n sequence\'s length is added to it. The resulting value must be a\n nonnegative integer less than the sequence\'s length, and the\n sequence is asked to assign the assigned object to its item with\n that index. If the index is out of range, ``IndexError`` is raised\n (assignment to a subscripted sequence cannot add new items to a\n list).\n\n If the primary is a mapping object (such as a dictionary), the\n subscript must have a type compatible with the mapping\'s key type,\n and the mapping is then asked to create a key/datum pair which maps\n the subscript to the assigned object. This can either replace an\n existing key/value pair with the same key value, or insert a new\n key/value pair (if no key with the same value existed).\n\n* If the target is a slicing: The primary expression in the reference\n is evaluated. It should yield a mutable sequence object (such as a\n list). The assigned object should be a sequence object of the same\n type. Next, the lower and upper bound expressions are evaluated,\n insofar they are present; defaults are zero and the sequence\'s\n length. The bounds should evaluate to (small) integers. If either\n bound is negative, the sequence\'s length is added to it. The\n resulting bounds are clipped to lie between zero and the sequence\'s\n length, inclusive. Finally, the sequence object is asked to replace\n the slice with the items of the assigned sequence. The length of\n the slice may be different from the length of the assigned sequence,\n thus changing the length of the target sequence, if the object\n allows it.\n\n**CPython implementation detail:** In the current implementation, the\nsyntax for targets is taken to be the same as for expressions, and\ninvalid syntax is rejected during the code generation phase, causing\nless detailed error messages.\n\nWARNING: Although the definition of assignment implies that overlaps\nbetween the left-hand side and the right-hand side are \'safe\' (for\nexample ``a, b = b, a`` swaps two variables), overlaps *within* the\ncollection of assigned-to variables are not safe! For instance, the\nfollowing program prints ``[0, 2]``:\n\n x = [0, 1]\n i = 0\n i, x[i] = 1, 2\n print x\n\n\nAugmented assignment statements\n===============================\n\nAugmented assignment is the combination, in a single statement, of a\nbinary operation and an assignment statement:\n\n augmented_assignment_stmt ::= augtarget augop (expression_list | yield_expression)\n augtarget ::= identifier | attributeref | subscription | slicing\n augop ::= "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**="\n | ">>=" | "<<=" | "&=" | "^=" | "|="\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn augmented assignment evaluates the target (which, unlike normal\nassignment statements, cannot be an unpacking) and the expression\nlist, performs the binary operation specific to the type of assignment\non the two operands, and assigns the result to the original target.\nThe target is only evaluated once.\n\nAn augmented assignment expression like ``x += 1`` can be rewritten as\n``x = x + 1`` to achieve a similar, but not exactly equal effect. In\nthe augmented version, ``x`` is only evaluated once. Also, when\npossible, the actual operation is performed *in-place*, meaning that\nrather than creating a new object and assigning that to the target,\nthe old object is modified instead.\n\nWith the exception of assigning to tuples and multiple targets in a\nsingle statement, the assignment done by augmented assignment\nstatements is handled the same way as normal assignments. Similarly,\nwith the exception of the possible *in-place* behavior, the binary\noperation performed by augmented assignment is the same as the normal\nbinary operations.\n\nFor targets which are attribute references, the same *caveat about\nclass and instance attributes* applies as for regular assignments.\n',
6 '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',
20 'class': u'\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',
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',
28 'debugger': u'\n``pdb`` --- The Python Debugger\n*******************************\n\nThe module ``pdb`` defines an interactive source code debugger for\nPython programs. It supports setting (conditional) breakpoints and\nsingle stepping at the source line level, inspection of stack frames,\nsource code listing, and evaluation of arbitrary Python code in the\ncontext of any stack frame. It also supports post-mortem debugging\nand can be called under program control.\n\nThe debugger is extensible --- it is actually defined as the class\n``Pdb``. This is currently undocumented but easily understood by\nreading the source. The extension interface uses the modules ``bdb``\nand ``cmd``.\n\nThe debugger\'s prompt is ``(Pdb)``. Typical usage to run a program\nunder control of the debugger is:\n\n >>> import pdb\n >>> import mymodule\n >>> pdb.run(\'mymodule.test()\')\n > <string>(0)?()\n (Pdb) continue\n > <string>(1)?()\n (Pdb) continue\n NameError: \'spam\'\n > <string>(1)?()\n (Pdb)\n\n``pdb.py`` can also be invoked as a script to debug other scripts.\nFor example:\n\n python -m pdb myscript.py\n\nWhen invoked as a script, pdb will automatically enter post-mortem\ndebugging if the program being debugged exits abnormally. After post-\nmortem debugging (or after normal exit of the program), pdb will\nrestart the program. Automatic restarting preserves pdb\'s state (such\nas breakpoints) and in most cases is more useful than quitting the\ndebugger upon program\'s exit.\n\nNew in version 2.4: Restarting post-mortem behavior added.\n\nThe typical usage to break into the debugger from a running program is\nto insert\n\n import pdb; pdb.set_trace()\n\nat the location you want to break into the debugger. You can then\nstep through the code following this statement, and continue running\nwithout the debugger using the ``c`` command.\n\nThe typical usage to inspect a crashed program is:\n\n >>> import pdb\n >>> import mymodule\n >>> mymodule.test()\n Traceback (most recent call last):\n File "<stdin>", line 1, in ?\n File "./mymodule.py", line 4, in test\n test2()\n File "./mymodule.py", line 3, in test2\n print spam\n NameError: spam\n >>> pdb.pm()\n > ./mymodule.py(3)test2()\n -> print spam\n (Pdb)\n\nThe module defines the following functions; each enters the debugger\nin a slightly different way:\n\npdb.run(statement[, globals[, locals]])\n\n Execute the *statement* (given as a string) under debugger control.\n The debugger prompt appears before any code is executed; you can\n set breakpoints and type ``continue``, or you can step through the\n statement using ``step`` or ``next`` (all these commands are\n explained below). The optional *globals* and *locals* arguments\n specify the environment in which the code is executed; by default\n the dictionary of the module ``__main__`` is used. (See the\n explanation of the ``exec`` statement or the ``eval()`` built-in\n function.)\n\npdb.runeval(expression[, globals[, locals]])\n\n Evaluate the *expression* (given as a string) under debugger\n control. When ``runeval()`` returns, it returns the value of the\n expression. Otherwise this function is similar to ``run()``.\n\npdb.runcall(function[, argument, ...])\n\n Call the *function* (a function or method object, not a string)\n with the given arguments. When ``runcall()`` returns, it returns\n whatever the function call returned. The debugger prompt appears\n as soon as the function is entered.\n\npdb.set_trace()\n\n Enter the debugger at the calling stack frame. This is useful to\n hard-code a breakpoint at a given point in a program, even if the\n code is not otherwise being debugged (e.g. when an assertion\n fails).\n\npdb.post_mortem([traceback])\n\n Enter post-mortem debugging of the given *traceback* object. If no\n *traceback* is given, it uses the one of the exception that is\n currently being handled (an exception must be being handled if the\n default is to be used).\n\npdb.pm()\n\n Enter post-mortem debugging of the traceback found in\n ``sys.last_traceback``.\n\nThe ``run*`` functions and ``set_trace()`` are aliases for\ninstantiating the ``Pdb`` class and calling the method of the same\nname. If you want to access further features, you have to do this\nyourself:\n\nclass class pdb.Pdb(completekey=\'tab\', stdin=None, stdout=None, skip=None)\n\n ``Pdb`` is the debugger class.\n\n The *completekey*, *stdin* and *stdout* arguments are passed to the\n underlying ``cmd.Cmd`` class; see the description there.\n\n The *skip* argument, if given, must be an iterable of glob-style\n module name patterns. The debugger will not step into frames that\n originate in a module that matches one of these patterns. [1]\n\n Example call to enable tracing with *skip*:\n\n import pdb; pdb.Pdb(skip=[\'django.*\']).set_trace()\n\n New in version 2.7: The *skip* argument.\n\n run(statement[, globals[, locals]])\n runeval(expression[, globals[, locals]])\n runcall(function[, argument, ...])\n set_trace()\n\n See the documentation for the functions explained above.\n',
30 'dict': u'\nDictionary displays\n*******************\n\nA dictionary display is a possibly empty series of key/datum pairs\nenclosed in curly braces:\n\n dict_display ::= "{" [key_datum_list | dict_comprehension] "}"\n key_datum_list ::= key_datum ("," key_datum)* [","]\n key_datum ::= expression ":" expression\n dict_comprehension ::= expression ":" expression comp_for\n\nA dictionary display yields a new dictionary object.\n\nIf a comma-separated sequence of key/datum pairs is given, they are\nevaluated from left to right to define the entries of the dictionary:\neach key object is used as a key into the dictionary to store the\ncorresponding datum. This means that you can specify the same key\nmultiple times in the key/datum list, and the final dictionary\'s value\nfor that key will be the last one given.\n\nA dict comprehension, in contrast to list and set comprehension
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_contains.py9 class set(base_set): class in inherits:base_set
21 b = set(1)
H A Dtest_modulefinder.py9 try: set
10 except NameError: from sets import Set as set namespace
244 modules = set(modules)
245 found = set(mf.modules.keys())
H A Dtest_py3kwarn.py205 def set(): function in function:TestPy3KWarnings.test_softspace
208 self.assertWarning(set(), w, expected)
230 self.assertWarning(None, w, expected.format('set'))
H A Dtest_support.py159 verbose = 1 # Flag set to 0 by regrtest.py
160 use_resources = None # Flag set to [] by regrtest.py
208 """Test whether a resource is enabled. Known resources are set by
218 # the resource was set
232 the specified host address (defaults to 0.0.0.0) with the port set to 0,
258 However, on Windows, if SO_REUSEADDR is set on the sockets, no EADDRINUSE
294 or SO_REUSEPORT set on it. Tests should *never* set these socket options
299 on Windows), it will be set on the socket. This will prevent anyone else
305 raise TestFailed("tests should never set th
684 def set(self, envvar, value): member in class:EnvironmentVarGuard
[all...]
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.2/Lib/xml/dom/
H A Dminicompat.py104 def set(self, value, name=name): function in function:defproperty
109 prop = property(get, set, doc=doc)
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.2/Lib/xml/etree/
H A DElementTree.py182 # {@link #Element.set},
431 # @param key What attribute to set.
434 def set(self, key, value): member in class:Element
464 # elements may or may not be included. To get a stable set, use the
945 HTML_EMPTY = set(HTML_EMPTY)

Completed in 646 milliseconds

12