Searched defs:lower (Results 1 - 24 of 24) sorted by path

/device/linaro/bootloader/edk2/AppPkg/Applications/Python/PyMod-2.7.2/Lib/
H A Dpydoc.py57 from string import expandtabs, find, join, lower, split, strip, rfind, rstrip namespace
1751 if lower(request) in ('q', 'quit'): break
1928 if key: key = lower(key)
1939 if find(lower(modname + ' - ' + desc), key) >= 0:
1962 if find(lower(modname + ' - ' + desc), key) >= 0:
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.10/Include/
H A DPython-ast.h320 expr_ty lower; member in struct:_slice::__anon2647::__anon2648
514 slice_ty _Py_Slice(expr_ty lower, expr_ty upper, expr_ty step, PyArena *arena);
/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',
21 'comparisons': u'\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation. Also unlike C, expressions like "a < b < c" have the\ninterpretation that is conventional in mathematics:\n\n comparison ::= or_expr ( comp_operator or_expr )*\n comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "<>" | "!="\n | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: "True" or "False".\n\nComparisons can be chained arbitrarily, e.g., "x < y <= z" is\nequivalent to "x < y and y <= z", except that "y" is evaluated only\nonce (but in both cases "z" is not evaluated at all when "x < y" is\nfound to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then "a op1 b op2 c ... y\nopN z" is equivalent to "a op1 b and b op2 c and ... y opN z", except\nthat each expression is evaluated at most once.\n\nNote that "a op1 b op2 c" doesn\'t imply any kind of comparison between\n*a* and *c*, so that, e.g., "x < y > z" is perfectly legal (though\nperhaps not pretty).\n\nThe forms "<>" and "!=" are equivalent; for consistency with C, "!="\nis preferred; where "!=" is mentioned below "<>" is also accepted.\nThe "<>" spelling is considered obsolescent.\n\nThe operators "<", ">", "==", ">=", "<=", and "!=" compare the values\nof two objects. The objects need not have the same type. If both are\nnumbers, they are converted to a common type. Otherwise, objects of\ndifferent types *always* compare unequal, and are ordered consistently\nbut arbitrarily. You can control comparison behavior of objects of\nnon-built-in types by defining a "__cmp__" method or rich comparison\nmethods like "__gt__", described in section Special method names.\n\n(This unusual definition of comparison was used to simplify the\ndefinition of operations like sorting and the "in" and "not in"\noperators. In the future, the comparison rules for objects of\ndifferent types are likely to change.)\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* Strings are compared lexicographically using the numeric\n equivalents (the result of the built-in function "ord()") of their\n characters. Unicode and 8-bit strings are fully interoperable in\n this behavior. [4]\n\n* Tuples and lists are compared lexicographically using comparison\n of corresponding elements. This means that to compare equal, each\n element must compare equal and the two sequences must be of the same\n type and have the same length.\n\n If not equal, the sequences are ordered the same as their first\n differing elements. For example, "cmp([1,2,x], [1,2,y])" returns\n the same as "cmp(x,y)". If the corresponding element does not\n exist, the shorter sequence is ordered first (for example, "[1,2] <\n [1,2,3]").\n\n* Mappings (dictionaries) compare equal if and only if their sorted\n (key, value) lists compare equal. [5] Outcomes other than equality\n are resolved consistently, but are not otherwise defined. [6]\n\n* Most other objects of built-in types compare unequal unless they\n are the same object; the choice whether one object is considered\n smaller or larger than another one is made arbitrarily but\n consistently within one execution of a program.\n\nThe operators "in" and "not in" test for collection membership. "x in\ns" evaluates to true if *x* is a member of the collection *s*, and\nfalse otherwise. "x not in s" returns the negation of "x in s". The\ncollection membership test has traditionally been bound to sequences;\nan object is a member of a collection if the collection is a sequence\nand contains an element equal to that object. However, it make sense\nfor many other object types to support membership tests without being\na sequence. In particular, dictionaries (for keys) and sets support\nmembership testing.\n\nFor the list and tuple types, "x in y" is true if and only if there\nexists an index *i* such that "x == y[i]" is true.\n\nFor the Unicode and string types, "x in y" is true if and only if *x*\nis a substring of *y*. An equivalent test is "y.find(x) != -1".\nNote, *x* and *y* need not be the same type; consequently, "u\'ab\' in\n\'abc\'" will return "True". Empty strings are always considered to be a\nsubstring of any other string, so """ in "abc"" will return "True".\n\nChanged in version 2.3: Previously, *x* was required to be a string of\nlength "1".\n\nFor user-defined classes which define the "__contains__()" method, "x\nin y" is true if and only if "y.__contains__(x)" is true.\n\nFor user-defined classes which do not define "__contains__()" but do\ndefine "__iter__()", "x in y" is true if some value "z" with "x == z"\nis produced while iterating over "y". If an exception is raised\nduring the iteration, it is as if "in" raised that exception.\n\nLastly, the old-style iteration protocol is tried: if a class defines\n"__getitem__()", "x in y" is true if and only if there is a non-\nnegative integer index *i* such that "x == y[i]", and all lower\ninteger indices do not raise "IndexError" exception. (If any other\nexception is raised, it is as if "in" raised that exception).\n\nThe operator "not in" is defined to have the inverse true value of\n"in".\n\nThe operators "is" and "is not" test for object identity: "x is y" is\ntrue if and only if *x* and *y* are the same object. "x is not y"\nyields the inverse truth value. [7]\n',
38 'formatstrings': u'\nFormat String Syntax\n********************\n\nThe "str.format()" method and the "Formatter" class share the same\nsyntax for format strings (although in the case of "Formatter",\nsubclasses can define their own format string syntax).\n\nFormat strings contain "replacement fields" surrounded by curly braces\n"{}". Anything that is not contained in braces is considered literal\ntext, which is copied unchanged to the output. If you need to include\na brace character in the literal text, it can be escaped by doubling:\n"{{" and "}}".\n\nThe grammar for a replacement field is as follows:\n\n replacement_field ::= "{" [field_name] ["!" conversion] [":" format_spec] "}"\n field_name ::= arg_name ("." attribute_name | "[" element_index "]")*\n arg_name ::= [identifier | integer]\n attribute_name ::= identifier\n element_index ::= integer | index_string\n index_string ::= <any source character except "]"> +\n conversion ::= "r" | "s"\n format_spec ::= <described in the next section>\n\nIn less formal terms, the replacement field can start with a\n*field_name* that specifies the object whose value is to be formatted\nand inserted into the output instead of the replacement field. The\n*field_name* is optionally followed by a *conversion* field, which is\npreceded by an exclamation point "\'!\'", and a *format_spec*, which is\npreceded by a colon "\':\'". These specify a non-default format for the\nreplacement value.\n\nSee also the Format Specification Mini-Language section.\n\nThe *field_name* itself begins with an *arg_name* that is either a\nnumber or a keyword. If it\'s a number, it refers to a positional\nargument, and if it\'s a keyword, it refers to a named keyword\nargument. If the numerical arg_names in a format string are 0, 1, 2,\n... in sequence, they can all be omitted (not just some) and the\nnumbers 0, 1, 2, ... will be automatically inserted in that order.\nBecause *arg_name* is not quote-delimited, it is not possible to\nspecify arbitrary dictionary keys (e.g., the strings "\'10\'" or\n"\':-]\'") within a format string. The *arg_name* can be followed by any\nnumber of index or attribute expressions. An expression of the form\n"\'.name\'" selects the named attribute using "getattr()", while an\nexpression of the form "\'[index]\'" does an index lookup using\n"__getitem__()".\n\nChanged in version 2.7: The positional argument specifiers can be\nomitted, so "\'{} {}\'" is equivalent to "\'{0} {1}\'".\n\nSome simple format string examples:\n\n "First, thou shalt count to {0}" # References first positional argument\n "Bring me a {}" # Implicitly references the first positional argument\n "From {} to {}" # Same as "From {0} to {1}"\n "My quest is {name}" # References keyword argument \'name\'\n "Weight in tons {0.weight}" # \'weight\' attribute of first positional arg\n "Units destroyed: {players[0]}" # First element of keyword argument \'players\'.\n\nThe *conversion* field causes a type coercion before formatting.\nNormally, the job of formatting a value is done by the "__format__()"\nmethod of the value itself. However, in some cases it is desirable to\nforce a type to be formatted as a string, overriding its own\ndefinition of formatting. By converting the value to a string before\ncalling "__format__()", the normal formatting logic is bypassed.\n\nTwo conversion flags are currently supported: "\'!s\'" which calls\n"str()" on the value, and "\'!r\'" which calls "repr()".\n\nSome examples:\n\n "Harold\'s a clever {0!s}" # Calls str() on the argument first\n "Bring out the holy {name!r}" # Calls repr() on the argument first\n\nThe *format_spec* field contains a specification of how the value\nshould be presented, including such details as field width, alignment,\npadding, decimal precision and so on. Each value type can define its\nown "formatting mini-language" or interpretation of the *format_spec*.\n\nMost built-in types support a common formatting mini-language, which\nis described in the next section.\n\nA *format_spec* field can also include nested replacement fields\nwithin it. These nested replacement fields can contain only a field\nname; conversion flags and format specifications are not allowed. The\nreplacement fields within the format_spec are substituted before the\n*format_spec* string is interpreted. This allows the formatting of a\nvalue to be dynamically specified.\n\nSee the Format examples section for some examples.\n\n\nFormat Specification Mini-Language\n==================================\n\n"Format specifications" are used within replacement fields contained\nwithin a format string to define how individual values are presented\n(see Format String Syntax). They can also be passed directly to the\nbuilt-in "format()" function. Each formattable type may define how\nthe format specification is to be interpreted.\n\nMost built-in types implement the following options for format\nspecifications, although some of the formatting options are only\nsupported by the numeric types.\n\nA general convention is that an empty format string ("""") produces\nthe same result as if you had called "str()" on the value. A non-empty\nformat string typically modifies the result.\n\nThe general form of a *standard format specifier* is:\n\n format_spec ::= [[fill]align][sign][#][0][width][,][.precision][type]\n fill ::= <any character>\n align ::= "<" | ">" | "=" | "^"\n sign ::= "+" | "-" | " "\n width ::= integer\n precision ::= integer\n type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"\n\nIf a valid *align* value is specified, it can be preceded by a *fill*\ncharacter that can be any character and defaults to a space if\nomitted. Note that it is not possible to use "{" and "}" as *fill*\nchar while using the "str.format()" method; this limitation however\ndoesn\'t affect the "format()" function.\n\nThe meaning of the various alignment options is as follows:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | "\'<\'" | Forces the field to be left-aligned within the available |\n | | space (this is the default for most objects). |\n +-----------+------------------------------------------------------------+\n | "\'>\'" | Forces the field to be right-aligned within the available |\n | | space (this is the default for numbers). |\n +-----------+------------------------------------------------------------+\n | "\'=\'" | Forces the padding to be placed after the sign (if any) |\n | | but before the digits. This is used for printing fields |\n | | in the form \'+000000120\'. This alignment option is only |\n | | valid for numeric types. |\n +-----------+------------------------------------------------------------+\n | "\'^\'" | Forces the field to be centered within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n\nNote that unless a minimum field width is defined, the field width\nwill always be the same size as the data to fill it, so that the\nalignment option has no meaning in this case.\n\nThe *sign* option is only valid for number types, and can be one of\nthe following:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | "\'+\'" | indicates that a sign should be used for both positive as |\n | | well as negative numbers. |\n +-----------+------------------------------------------------------------+\n | "\'-\'" | indicates that a sign should be used only for negative |\n | | numbers (this is the default behavior). |\n +-----------+------------------------------------------------------------+\n | space | indicates that a leading space should be used on positive |\n | | numbers, and a minus sign on negative numbers. |\n +-----------+------------------------------------------------------------+\n\nThe "\'#\'" option is only valid for integers, and only for binary,\noctal, or hexadecimal output. If present, it specifies that the\noutput will be prefixed by "\'0b\'", "\'0o\'", or "\'0x\'", respectively.\n\nThe "\',\'" option signals the use of a comma for a thousands separator.\nFor a locale aware separator, use the "\'n\'" integer presentation type\ninstead.\n\nChanged in version 2.7: Added the "\',\'" option (see also **PEP 378**).\n\n*width* is a decimal integer defining the minimum field width. If not\nspecified, then the field width will be determined by the content.\n\nPreceding the *width* field by a zero ("\'0\'") character enables sign-\naware zero-padding for numeric types. This is equivalent to a *fill*\ncharacter of "\'0\'" with an *alignment* type of "\'=\'".\n\nThe *precision* is a decimal number indicating how many digits should\nbe displayed after the decimal point for a floating point value\nformatted with "\'f\'" and "\'F\'", or before and after the decimal point\nfor a floating point value formatted with "\'g\'" or "\'G\'". For non-\nnumber types the field indicates the maximum field size - in other\nwords, how many characters will be used from the field content. The\n*precision* is not allowed for integer values.\n\nFinally, the *type* determines how the data should be presented.\n\nThe available string presentation types are:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | "\'s\'" | String format. This is the default type for strings and |\n | | may be omitted. |\n +-----------+------------------------------------------------------------+\n | None | The same as "\'s\'". |\n +-----------+------------------------------------------------------------+\n\nThe available integer presentation types are:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | "\'b\'" | Binary format. Outputs the number in base 2. |\n +-----------+------------------------------------------------------------+\n | "\'c\'" | Character. Converts the integer to the corresponding |\n | | unicode character before printing. |\n +-----------+------------------------------------------------------------+\n | "\'d\'" | Decimal Integer. Outputs the number in base 10. |\n +-----------+------------------------------------------------------------+\n | "\'o\'" | Octal format. Outputs the number in base 8. |\n +-----------+------------------------------------------------------------+\n | "\'x\'" | Hex format. Outputs the number in base 16, using lower- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | "\'X\'" | Hex format. Outputs the number in base 16, using upper- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | "\'n\'" | Number. This is the same as "\'d\'", except that it uses the |\n | | current locale setting to insert the appropriate number |\n | | separator characters. |\n +-----------+------------------------------------------------------------+\n | None | The same as "\'d\'". |\n +-----------+------------------------------------------------------------+\n\nIn addition to the above presentation types, integers can be formatted\nwith the floating point presentation types listed below (except "\'n\'"\nand None). When doing so, "float()" is used to convert the integer to\na floating point number before formatting.\n\nThe available presentation types for floating point and decimal values\nare:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | "\'e\'" | Exponent notation. Prints the number in scientific |\n | | notation using the letter \'e\' to indicate the exponent. |\n | | The default precision is "6". |\n +-----------+------------------------------------------------------------+\n | "\'E\'" | Exponent notation. Same as "\'e\'" except it uses an upper |\n | | case \'E\' as the separator character. |\n +-----------+------------------------------------------------------------+\n | "\'f\'" | Fixed point. Displays the number as a fixed-point number. |\n | | The default precision is "6". |\n +-----------+------------------------------------------------------------+\n | "\'F\'" | Fixed point. Same as "\'f\'". |\n +-----------+------------------------------------------------------------+\n | "\'g\'" | General format. For a given precision "p >= 1", this |\n | | rounds the number to "p" significant digits and then |\n | | formats the result in either fixed-point format or in |\n | | scientific notation, depending on its magnitude. The |\n | | precise rules are as follows: suppose that the result |\n | | formatted with presentation type "\'e\'" and precision "p-1" |\n | | would have exponent "exp". Then if "-4 <= exp < p", the |\n | | number is formatted with presentation type "\'f\'" and |\n | | precision "p-1-exp". Otherwise, the number is formatted |\n | | with presentation type "\'e\'" and precision "p-1". In both |\n | | cases insignificant trailing zeros are removed from the |\n | | significand, and the decimal point is also removed if |\n | | there are no remaining digits following it. Positive and |\n | | negative infinity, positive and negative zero, and nans, |\n | | are formatted as "inf", "-inf", "0", "-0" and "nan" |\n | | respectively, regardless of the precision. A precision of |\n | | "0" is treated as equivalent to a precision of "1". The |\n | | default precision is "6". |\n +-----------+------------------------------------------------------------+\n | "\'G\'" | General format. Same as "\'g\'" except switches to "\'E\'" if |\n | | the number gets too large. The representations of infinity |\n | | and NaN are uppercased, too. |\n +-----------+------------------------------------------------------------+\n | "\'n\'" | Number. This is the same as "\'g\'", except that it uses the |\n | | current locale setting to insert the appropriate number |\n | | separator characters. |\n +-----------+------------------------------------------------------------+\n | "\'%\'" | Percentage. Multiplies the number by 100 and displays in |\n | | fixed ("\'f\'") format, followed by a percent sign. |\n +-----------+------------------------------------------------------------+\n | None | The same as "\'g\'". |\n +-----------+------------------------------------------------------------+\n\n\nFormat examples\n===============\n\nThis section contains examples of the new format syntax and comparison\nwith the old "%"-formatting.\n\nIn most of the cases the syntax is similar to the old "%"-formatting,\nwith the addition of the "{}" and with ":" used instead of "%". For\nexample, "\'%03.2f\'" can be translated to "\'{:03.2f}\'".\n\nThe new format syntax also supports new and different options, shown\nin the follow examples.\n\nAccessing arguments by position:\n\n >>> \'{0}, {1}, {2}\'.format(\'a\', \'b\', \'c\')\n \'a, b, c\'\n >>> \'{}, {}, {}\'.format(\'a\', \'b\', \'c\') # 2.7+ only\n \'a, b, c\'\n >>> \'{2}, {1}, {0}\'.format(\'a\', \'b\', \'c\')\n \'c, b, a\'\n >>> \'{2}, {1}, {0}\'.format(*\'abc\') # unpacking argument sequence\n \'c, b, a\'\n >>> \'{0}{1}{0}\'.format(\'abra\', \'cad\') # arguments\' indices can be repeated\n \'abracadabra\'\n\nAccessing arguments by name:\n\n >>> \'Coordinates: {latitude}, {longitude}\'.format(latitude=\'37.24N\', longitude=\'-115.81W\')\n \'Coordinates: 37.24N, -115.81W\'\n >>> coord = {\'latitude\': \'37.24N\', \'longitude\': \'-115.81W\'}\n >>> \'Coordinates: {latitude}, {longitude}\'.format(**coord)\n \'Coordinates: 37.24N, -115.81W\'\n\nAccessing arguments\' attributes:\n\n >>> c = 3-5j\n >>> (\'The complex number {0} is formed from the real part {0.real} \'\n ... \'and the imaginary part {0.imag}.\').format(c)\n \'The complex number (3-5j) is formed from the real part 3.0 and the imaginary part -5.0.\'\n >>> class Point(object):\n ... def __init__(self, x, y):\n ... self.x, self.y = x, y\n ... def __str__(self):\n ... return \'Point({self.x}, {self.y})\'.format(self=self)\n ...\n >>> str(Point(4, 2))\n \'Point(4, 2)\'\n\nAccessing arguments\' items:\n\n >>> coord = (3, 5)\n >>> \'X: {0[0]}; Y: {0[1]}\'.format(coord)\n \'X: 3; Y: 5\'\n\nReplacing "%s" and "%r":\n\n >>> "repr() shows quotes: {!r}; str() doesn\'t: {!s}".format(\'test1\', \'test2\')\n "repr() shows quotes: \'test1\'; str() doesn\'t: test2"\n\nAligning the text and specifying a width:\n\n >>> \'{:<30}\'.format(\'left aligned\')\n \'left aligned \'\n >>> \'{:>30}\'.format(\'right aligned\')\n \' right aligned\'\n >>> \'{:^30}\'.format(\'centered\')\n \' centered \'\n >>> \'{:*^30}\'.format(\'centered\') # use \'*\' as a fill char\n \'***********centered***********\'\n\nReplacing "%+f", "%-f", and "% f" and specifying a sign:\n\n >>> \'{:+f}; {:+f}\'.format(3.14, -3.14) # show it always\n \'+3.140000; -3.140000\'\n >>> \'{: f}; {: f}\'.format(3.14, -3.14) # show a space for positive numbers\n \' 3.140000; -3.140000\'\n >>> \'{:-f}; {:-f}\'.format(3.14, -3.14) # show only the minus -- same as \'{:f}; {:f}\'\n \'3.140000; -3.140000\'\n\nReplacing "%x" and "%o" and converting the value to different bases:\n\n >>> # format also supports binary numbers\n >>> "int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}".format(42)\n \'int: 42; hex: 2a; oct: 52; bin: 101010\'\n >>> # with 0x, 0o, or 0b as prefix:\n >>> "int: {0:d}; hex: {0:#x}; oct: {0:#o}; bin: {0:#b}".format(42)\n \'int: 42; hex: 0x2a; oct: 0o52; bin: 0b101010\'\n\nUsing the comma as a thousands separator:\n\n >>> \'{:,}\'.format(1234567890)\n \'1,234,567,890\'\n\nExpressing a percentage:\n\n >>> points = 19.5\n >>> total = 22\n >>> \'Correct answers: {:.2%}\'.format(points/total)\n \'Correct answers: 88.64%\'\n\nUsing type-specific formatting:\n\n >>> import datetime\n >>> d = datetime.datetime(2010, 7, 4, 12, 15, 58)\n >>> \'{:%Y-%m-%d %H:%M:%S}\'.format(d)\n \'2010-07-04 12:15:58\'\n\nNesting arguments and more complex examples:\n\n >>> for align, text in zip(\'<^>\', [\'left\', \'center\', \'right\']):\n ... \'{0:{fill}{align}16}\'.format(text, fill=align, align=align)\n ...\n \'left<<<<<<<<<<<<\'\n \'^^^^^center^^^^^\'\n \'>>>>>>>>>>>right\'\n >>>\n >>> octets = [192, 168, 0, 1]\n >>> \'{:02X}{:02X}{:02X}{:02X}\'.format(*octets)\n \'C0A80001\'\n >>> int(_, 16)\n 3232235521\n >>>\n >>> width = 5\n >>> for num in range(5,12):\n ... for base in \'dXob\':\n ... print \'{0:{width}{base}}\'.format(num, base=base, width=width),\n ... print\n ...\n 5 5 5 101\n 6 6 6 110\n 7 7 7 111\n 8 8 10 1000\n 9 9 11 1001\n 10 A 12 1010\n 11 B 13 1011\n',
46 'in': u'\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation. Also unlike C, expressions like "a < b < c" have the\ninterpretation that is conventional in mathematics:\n\n comparison ::= or_expr ( comp_operator or_expr )*\n comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "<>" | "!="\n | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: "True" or "False".\n\nComparisons can be chained arbitrarily, e.g., "x < y <= z" is\nequivalent to "x < y and y <= z", except that "y" is evaluated only\nonce (but in both cases "z" is not evaluated at all when "x < y" is\nfound to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then "a op1 b op2 c ... y\nopN z" is equivalent to "a op1 b and b op2 c and ... y opN z", except\nthat each expression is evaluated at most once.\n\nNote that "a op1 b op2 c" doesn\'t imply any kind of comparison between\n*a* and *c*, so that, e.g., "x < y > z" is perfectly legal (though\nperhaps not pretty).\n\nThe forms "<>" and "!=" are equivalent; for consistency with C, "!="\nis preferred; where "!=" is mentioned below "<>" is also accepted.\nThe "<>" spelling is considered obsolescent.\n\nThe operators "<", ">", "==", ">=", "<=", and "!=" compare the values\nof two objects. The objects need not have the same type. If both are\nnumbers, they are converted to a common type. Otherwise, objects of\ndifferent types *always* compare unequal, and are ordered consistently\nbut arbitrarily. You can control comparison behavior of objects of\nnon-built-in types by defining a "__cmp__" method or rich comparison\nmethods like "__gt__", described in section Special method names.\n\n(This unusual definition of comparison was used to simplify the\ndefinition of operations like sorting and the "in" and "not in"\noperators. In the future, the comparison rules for objects of\ndifferent types are likely to change.)\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* Strings are compared lexicographically using the numeric\n equivalents (the result of the built-in function "ord()") of their\n characters. Unicode and 8-bit strings are fully interoperable in\n this behavior. [4]\n\n* Tuples and lists are compared lexicographically using comparison\n of corresponding elements. This means that to compare equal, each\n element must compare equal and the two sequences must be of the same\n type and have the same length.\n\n If not equal, the sequences are ordered the same as their first\n differing elements. For example, "cmp([1,2,x], [1,2,y])" returns\n the same as "cmp(x,y)". If the corresponding element does not\n exist, the shorter sequence is ordered first (for example, "[1,2] <\n [1,2,3]").\n\n* Mappings (dictionaries) compare equal if and only if their sorted\n (key, value) lists compare equal. [5] Outcomes other than equality\n are resolved consistently, but are not otherwise defined. [6]\n\n* Most other objects of built-in types compare unequal unless they\n are the same object; the choice whether one object is considered\n smaller or larger than another one is made arbitrarily but\n consistently within one execution of a program.\n\nThe operators "in" and "not in" test for collection membership. "x in\ns" evaluates to true if *x* is a member of the collection *s*, and\nfalse otherwise. "x not in s" returns the negation of "x in s". The\ncollection membership test has traditionally been bound to sequences;\nan object is a member of a collection if the collection is a sequence\nand contains an element equal to that object. However, it make sense\nfor many other object types to support membership tests without being\na sequence. In particular, dictionaries (for keys) and sets support\nmembership testing.\n\nFor the list and tuple types, "x in y" is true if and only if there\nexists an index *i* such that "x == y[i]" is true.\n\nFor the Unicode and string types, "x in y" is true if and only if *x*\nis a substring of *y*. An equivalent test is "y.find(x) != -1".\nNote, *x* and *y* need not be the same type; consequently, "u\'ab\' in\n\'abc\'" will return "True". Empty strings are always considered to be a\nsubstring of any other string, so """ in "abc"" will return "True".\n\nChanged in version 2.3: Previously, *x* was required to be a string of\nlength "1".\n\nFor user-defined classes which define the "__contains__()" method, "x\nin y" is true if and only if "y.__contains__(x)" is true.\n\nFor user-defined classes which do not define "__contains__()" but do\ndefine "__iter__()", "x in y" is true if some value "z" with "x == z"\nis produced while iterating over "y". If an exception is raised\nduring the iteration, it is as if "in" raised that exception.\n\nLastly, the old-style iteration protocol is tried: if a class defines\n"__getitem__()", "x in y" is true if and only if there is a non-\nnegative integer index *i* such that "x == y[i]", and all lower\ninteger indices do not raise "IndexError" exception. (If any other\nexception is raised, it is as if "in" raised that exception).\n\nThe operator "not in" is defined to have the inverse true value of\n"in".\n\nThe operators "is" and "is not" test for object identity: "x is y" is\ntrue if and only if *x* and *y* are the same object. "x is not y"\nyields the inverse truth value. [7]\n',
47 'integers': u'\nInteger and long integer literals\n*********************************\n\nInteger and long integer literals are described by the following\nlexical definitions:\n\n longinteger ::= integer ("l" | "L")\n integer ::= decimalinteger | octinteger | hexinteger | bininteger\n decimalinteger ::= nonzerodigit digit* | "0"\n octinteger ::= "0" ("o" | "O") octdigit+ | "0" octdigit+\n hexinteger ::= "0" ("x" | "X") hexdigit+\n bininteger ::= "0" ("b" | "B") bindigit+\n nonzerodigit ::= "1"..."9"\n octdigit ::= "0"..."7"\n bindigit ::= "0" | "1"\n hexdigit ::= digit | "a"..."f" | "A"..."F"\n\nAlthough both lower case "\'l\'" and upper case "\'L\'" are allowed as\nsuffix for long integers, it is strongly recommended to always use\n"\'L\'", since the letter "\'l\'" looks too much like the digit "\'1\'".\n\nPlain integer literals that are above the largest representable plain\ninteger (e.g., 2147483647 when using 32-bit arithmetic) are accepted\nas if they were long integers instead. [1] There is no limit for long\ninteger literals apart from what can be stored in available memory.\n\nSome examples of plain integer literals (first row) and long integer\nliterals (second and third rows):\n\n 7 2147483647 0177\n 3L 79228162514264337593543950336L 0377L 0x100000000L\n 79228162514264337593543950336 0xdeadbeef\n',
61 'shifting': u'\nShifting operations\n*******************\n\nThe shifting operations have lower priority than the arithmetic\noperations:\n\n shift_expr ::= a_expr | shift_expr ( "<<" | ">>" ) a_expr\n\nThese operators accept plain or long integers as arguments. The\narguments are converted to a common type. They shift the first\nargument to the left or right by the number of bits given by the\nsecond argument.\n\nA right shift by *n* bits is defined as division by "pow(2, n)". A\nleft shift by *n* bits is defined as multiplication with "pow(2, n)".\nNegative shift counts raise a "ValueError" exception.\n\nNote: In the current implementation, the right-hand operand is\n required to be at most "sys.maxsize". If the right-hand operand is\n larger than "sys.maxsize" an "OverflowError" exception is raised.\n',
62 'slicings': u'\nSlicings\n********\n\nA slicing selects a range of items in a sequence object (e.g., a\nstring, tuple or list). Slicings may be used as expressions or as\ntargets in assignment or "del" statements. The syntax for a slicing:\n\n slicing ::= simple_slicing | extended_slicing\n simple_slicing ::= primary "[" short_slice "]"\n extended_slicing ::= primary "[" slice_list "]"\n slice_list ::= slice_item ("," slice_item)* [","]\n slice_item ::= expression | proper_slice | ellipsis\n proper_slice ::= short_slice | long_slice\n short_slice ::= [lower_bound] ":" [upper_bound]\n long_slice ::= short_slice ":" [stride]\n lower_bound ::= expression\n upper_bound ::= expression\n stride ::= expression\n ellipsis ::= "..."\n\nThere is ambiguity in the formal syntax here: anything that looks like\nan expression list also looks like a slice list, so any subscription\ncan be interpreted as a slicing. Rather than further complicating the\nsyntax, this is disambiguated by defining that in this case the\ninterpretation as a subscription takes priority over the\ninterpretation as a slicing (this is the case if the slice list\ncontains no proper slice nor ellipses). Similarly, when the slice\nlist has exactly one short slice and no trailing comma, the\ninterpretation as a simple slicing takes priority over that as an\nextended slicing.\n\nThe semantics for a simple slicing are as follows. The primary must\nevaluate to a sequence object. The lower and upper bound expressions,\nif present, must evaluate to plain integers; defaults are zero and the\n"sys.maxint", respectively. If either bound is negative, the\nsequence\'s length is added to it. The slicing now selects all items\nwith index *k* such that "i <= k < j" where *i* and *j* are the\nspecified lower an
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/
H A Dstring.py221 # convert UPPER CASE letters to lower case
222 def lower(s): function
223 """lower(s) -> string
228 return s.lower()
230 # Convert lower case letters to UPPER CASE
239 # Swap lower case letters and UPPER CASE
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.10/Modules/
H A Dsre.h95 SRE_TOLOWER_HOOK lower; member in struct:__anon2831
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.10/Objects/
H A Dunicodectype.c27 const Py_UNICODE lower; member in struct:__anon2882
167 int delta = ctype->lower;
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.10/PyMod-2.7.10/Lib/
H A Dpydoc.py71 from string import expandtabs, find, join, lower, split, strip, rfind, rstrip namespace
1831 if lower(request) in ('q', 'quit'): break
2008 if key: key = lower(key)
2019 if find(lower(modname + ' - ' + desc), key) >= 0:
2042 if find(lower(modname + ' - ' + desc), key) >= 0:
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.10/Python/
H A DPython-ast.c288 "lower",
1996 Slice(expr_ty lower, expr_ty upper, expr_ty step, PyArena *arena) argument
2003 p->v.Slice.lower = lower;
2977 value = ast2obj_expr(o->v.Slice.lower);
2979 if (PyObject_SetAttrString(result, "lower", value) == -1)
5851 expr_ty lower; local
5855 if (PyObject_HasAttrString(obj, "lower")) {
5857 tmp = PyObject_GetAttrString(obj, "lower");
5859 res = obj2ast_expr(tmp, &lower, aren
[all...]
H A Dast.c1520 expr_ty lower = NULL, upper = NULL, step = NULL; local
1543 lower = ast_for_expr(c, ch);
1544 if (!lower)
1595 return Slice(lower, upper, step, c->c_arena);
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.2/Include/
H A DPython-ast.h320 expr_ty lower; member in struct:_slice::__anon2954::__anon2955
514 slice_ty _Py_Slice(expr_ty lower, expr_ty upper, expr_ty step, PyArena *arena);
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.2/Lib/
H A DUserString.py103 def lower(self): return self.__class__(self.data.lower()) member in class:UserString
228 __import__('test.test_' + called_as.lower())
H A Dpydoc.py57 from string import expandtabs, find, join, lower, split, strip, rfind, rstrip namespace
1747 if lower(request) in ('q', 'quit'): break
1924 if key: key = lower(key)
1935 if find(lower(modname + ' - ' + desc), key) >= 0:
1958 if find(lower(modname + ' - ' + desc), key) >= 0:
H A Dstring.py219 # convert UPPER CASE letters to lower case
220 def lower(s): function
221 """lower(s) -> string
226 return s.lower()
228 # Convert lower case letters to UPPER CASE
237 # Swap lower case letters and UPPER CASE
H A Dstringold.py45 # convert UPPER CASE letters to lower case
46 def lower(s): function
47 """lower(s) -> string
52 return s.lower()
54 # Convert lower case letters to UPPER CASE
63 # Swap lower case letters and UPPER CASE
/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',
13 'bltin-file-objects': u'\nFile Objects\n************\n\nFile objects are implemented using C\'s ``stdio`` package and can be\ncreated with the built-in ``open()`` function. File objects are also\nreturned by some other built-in functions and methods, such as\n``os.popen()`` and ``os.fdopen()`` and the ``makefile()`` method of\nsocket objects. Temporary files can be created using the ``tempfile``\nmodule, and high-level file operations such as copying, moving, and\ndeleting files and directories can be achieved with the ``shutil``\nmodule.\n\nWhen a file operation fails for an I/O-related reason, the exception\n``IOError`` is raised. This includes situations where the operation\nis not defined for some reason, like ``seek()`` on a tty device or\nwriting a file opened for reading.\n\nFiles have the following methods:\n\nfile.close()\n\n Close the file. A closed file cannot be read or written any more.\n Any operation which requires that the file be open will raise a\n ``ValueError`` after the file has been closed. Calling ``close()``\n more than once is allowed.\n\n As of Python 2.5, you can avoid having to call this method\n explicitly if you use the ``with`` statement. For example, the\n following code will automatically close *f* when the ``with`` block\n is exited:\n\n from __future__ import with_statement # This isn\'t required in Python 2.6\n\n with open("hello.txt") as f:\n for line in f:\n print line\n\n In older versions of Python, you would have needed to do this to\n get the same effect:\n\n f = open("hello.txt")\n try:\n for line in f:\n print line\n finally:\n f.close()\n\n Note: Not all "file-like" types in Python support use as a context\n manager for the ``with`` statement. If your code is intended to\n work with any file-like object, you can use the function\n ``contextlib.closing()`` instead of using the object directly.\n\nfile.flush()\n\n Flush the internal buffer, like ``stdio``\'s ``fflush()``. This may\n be a no-op on some file-like objects.\n\n Note: ``flush()`` does not necessarily write the file\'s data to disk.\n Use ``flush()`` followed by ``os.fsync()`` to ensure this\n behavior.\n\nfile.fileno()\n\n Return the integer "file descriptor" that is used by the underlying\n implementation to request I/O operations from the operating system.\n This can be useful for other, lower level interfaces that use file\n descriptors, such as the ``fcntl`` module or ``os.read()`` and\n friends.\n\n Note: File-like objects which do not have a real file descriptor should\n *not* provide this method!\n\nfile.isatty()\n\n Return ``True`` if the file is connected to a tty(-like) device,\n else ``False``.\n\n Note: If a file-like object is not associated with a real file, this\n method should *not* be implemented.\n\nfile.next()\n\n A file object is its own iterator, for example ``iter(f)`` returns\n *f* (unless *f* is closed). When a file is used as an iterator,\n typically in a ``for`` loop (for example, ``for line in f: print\n line``), the ``next()`` method is called repeatedly. This method\n returns the next input line, or raises ``StopIteration`` when EOF\n is hit when the file is open for reading (behavior is undefined\n when the file is open for writing). In order to make a ``for``\n loop the most efficient way of looping over the lines of a file (a\n very common operation), the ``next()`` method uses a hidden read-\n ahead buffer. As a consequence of using a read-ahead buffer,\n combining ``next()`` with other file methods (like ``readline()``)\n does not work right. However, using ``seek()`` to reposition the\n file to an absolute position will flush the read-ahead buffer.\n\n New in version 2.3.\n\nfile.read([size])\n\n Read at most *size* bytes from the file (less if the read hits EOF\n before obtaining *size* bytes). If the *size* argument is negative\n or omitted, read all data until EOF is reached. The bytes are\n returned as a string object. An empty string is returned when EOF\n is encountered immediately. (For certain files, like ttys, it\n makes sense to continue reading after an EOF is hit.) Note that\n this method may call the underlying C function ``fread()`` more\n than once in an effort to acquire as close to *size* bytes as\n possible. Also note that when in non-blocking mode, less data than\n was requested may be returned, even if no *size* parameter was\n given.\n\n Note: This function is simply a wrapper for the underlying ``fread()``\n C function, and will behave the same in corner cases, such as\n whether the EOF value is cached.\n\nfile.readline([size])\n\n Read one entire line from the file. A trailing newline character\n is kept in the string (but may be absent when a file ends with an\n incomplete line). [5] If the *size* argument is present and non-\n negative, it is a maximum byte count (including the trailing\n newline) and an incomplete line may be returned. When *size* is not\n 0, an empty string is returned *only* when EOF is encountered\n immediately.\n\n Note: Unlike ``stdio``\'s ``fgets()``, the returned string contains null\n characters (``\'\\0\'``) if they occurred in the input.\n\nfile.readlines([sizehint])\n\n Read until EOF using ``readline()`` and return a list containing\n the lines thus read. If the optional *sizehint* argument is\n present, instead of reading up to EOF, whole lines totalling\n approximately *sizehint* bytes (possibly after rounding up to an\n internal buffer size) are read. Objects implementing a file-like\n interface may choose to ignore *sizehint* if it cannot be\n implemented, or cannot be implemented efficiently.\n\nfile.xreadlines()\n\n This method returns the same thing as ``iter(f)``.\n\n New in version 2.1.\n\n Deprecated since version 2.3: Use ``for line in file`` instead.\n\nfile.seek(offset[, whence])\n\n Set the file\'s current position, like ``stdio``\'s ``fseek()``. The\n *whence* argument is optional and defaults to ``os.SEEK_SET`` or\n ``0`` (absolute file positioning); other values are ``os.SEEK_CUR``\n or ``1`` (seek relative to the current position) and\n ``os.SEEK_END`` or ``2`` (seek relative to the file\'s end). There\n is no return value.\n\n For example, ``f.seek(2, os.SEEK_CUR)`` advances the position by\n two and ``f.seek(-3, os.SEEK_END)`` sets the position to the third\n to last.\n\n Note that if the file is opened for appending (mode ``\'a\'`` or\n ``\'a+\'``), any ``seek()`` operations will be undone at the next\n write. If the file is only opened for writing in append mode (mode\n ``\'a\'``), this method is essentially a no-op, but it remains useful\n for files opened in append mode with reading enabled (mode\n ``\'a+\'``). If the file is opened in text mode (without ``\'b\'``),\n only offsets returned by ``tell()`` are legal. Use of other\n offsets causes undefined behavior.\n\n Note that not all file objects are seekable.\n\n Changed in version 2.6: Passing float values as offset has been\n deprecated.\n\nfile.tell()\n\n Return the file\'s current position, like ``stdio``\'s ``ftell()``.\n\n Note: On Windows, ``tell()`` can return illegal values (after an\n ``fgets()``) when reading files with Unix-style line-endings. Use\n binary mode (``\'rb\'``) to circumvent this problem.\n\nfile.truncate([size])\n\n Truncate the file\'s size. If the optional *size* argument is\n present, the file is truncated to (at most) that size. The size\n defaults to the current position. The current file position is not\n changed. Note that if a specified size exceeds the file\'s current\n size, the result is platform-dependent: possibilities include that\n the file may remain unchanged, increase to the specified size as if\n zero-filled, or increase to the specified size with undefined new\n content. Availability: Windows, many Unix variants.\n\nfile.write(str)\n\n Write a string to the file. There is no return value. Due to\n buffering, the string may not actually show up in the file until\n the ``flush()`` or ``close()`` method is called.\n\nfile.writelines(sequence)\n\n Write a sequence of strings to the file. The sequence can be any\n iterable object producing strings, typically a list of strings.\n There is no return value. (The name is intended to match\n ``readlines()``; ``writelines()`` does not add line separators.)\n\nFiles support the iterator protocol. Each iteration returns the same\nresult as ``file.readline()``, and iteration ends when the\n``readline()`` method returns an empty string.\n\nFile objects also offer a number of other interesting attributes.\nThese are not required for file-like objects, but should be\nimplemented if they make sense for the particular object.\n\nfile.closed\n\n bool indicating the current state of the file object. This is a\n read-only attribute; the ``close()`` method changes the value. It\n may not be available on all file-like objects.\n\nfile.encoding\n\n The encoding that this file uses. When Unicode strings are written\n to a file, they will be converted to byte strings using this\n encoding. In addition, when the file is connected to a terminal,\n the attribute gives the encoding that the terminal is likely to use\n (that information might be incorrect if the user has misconfigured\n the terminal). The attribute is read-only and may not be present\n on all file-like objects. It may also be ``None``, in which case\n the file uses the system default encoding for converting Unicode\n strings.\n\n New in version 2.3.\n\nfile.errors\n\n The Unicode error handler used along with the encoding.\n\n New in version 2.6.\n\nfile.mode\n\n The I/O mode for the file. If the file was created using the\n ``open()`` built-in function, this will be the value of the *mode*\n parameter. This is a read-only attribute and may not be present on\n all file-like objects.\n\nfile.name\n\n If the file object was created using ``open()``, the name of the\n file. Otherwise, some string that indicates the source of the file\n object, of the form ``<...>``. This is a read-only attribute and\n may not be present on all file-like objects.\n\nfile.newlines\n\n If Python was built with universal newlines enabled (the default)\n this read-only attribute exists, and for files opened in universal\n newline read mode it keeps track of the types of newlines\n encountered while reading the file. The values it can take are\n ``\'\\r\'``, ``\'\\n\'``, ``\'\\r\\n\'``, ``None`` (unknown, no newlines read\n yet) or a tuple containing all the newline types seen, to indicate\n that multiple newline conventions were encountered. For files not\n opened in universal newline read mode the value of this attribute\n will be ``None``.\n\nfile.softspace\n\n Boolean that indicates whether a space character needs to be\n printed before another value when using the ``print`` statement.\n Classes that are trying to simulate a file object should also have\n a writable ``softspace`` attribute, which should be initialized to\n zero. This will be automatic for most classes implemented in\n Python (care may be needed for objects that override attribute\n access); types implemented in C will have to provide a writable\n ``softspace`` attribute.\n\n Note: This attribute is not used to control the ``print`` statement,\n but to allow the implementation of ``print`` to keep track of its\n internal state.\n',
22 'comparisons': u'\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation. Also unlike C, expressions like ``a < b < c`` have the\ninterpretation that is conventional in mathematics:\n\n comparison ::= or_expr ( comp_operator or_expr )*\n comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "<>" | "!="\n | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: ``True`` or ``False``.\n\nComparisons can be chained arbitrarily, e.g., ``x < y <= z`` is\nequivalent to ``x < y and y <= z``, except that ``y`` is evaluated\nonly once (but in both cases ``z`` is not evaluated at all when ``x <\ny`` is found to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y\nopN z`` is equivalent to ``a op1 b and b op2 c and ... y opN z``,\nexcept that each expression is evaluated at most once.\n\nNote that ``a op1 b op2 c`` doesn\'t imply any kind of comparison\nbetween *a* and *c*, so that, e.g., ``x < y > z`` is perfectly legal\n(though perhaps not pretty).\n\nThe forms ``<>`` and ``!=`` are equivalent; for consistency with C,\n``!=`` is preferred; where ``!=`` is mentioned below ``<>`` is also\naccepted. The ``<>`` spelling is considered obsolescent.\n\nThe operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare\nthe values of two objects. The objects need not have the same type.\nIf both are numbers, they are converted to a common type. Otherwise,\nobjects of different types *always* compare unequal, and are ordered\nconsistently but arbitrarily. You can control comparison behavior of\nobjects of non-built-in types by defining a ``__cmp__`` method or rich\ncomparison methods like ``__gt__``, described in section *Special\nmethod names*.\n\n(This unusual definition of comparison was used to simplify the\ndefinition of operations like sorting and the ``in`` and ``not in``\noperators. In the future, the comparison rules for objects of\ndifferent types are likely to change.)\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n Unicode and 8-bit strings are fully interoperable in this behavior.\n [4]\n\n* Tuples and lists are compared lexicographically using comparison of\n corresponding elements. This means that to compare equal, each\n element must compare equal and the two sequences must be of the same\n type and have the same length.\n\n If not equal, the sequences are ordered the same as their first\n differing elements. For example, ``cmp([1,2,x], [1,2,y])`` returns\n the same as ``cmp(x,y)``. If the corresponding element does not\n exist, the shorter sequence is ordered first (for example, ``[1,2] <\n [1,2,3]``).\n\n* Mappings (dictionaries) compare equal if and only if their sorted\n (key, value) lists compare equal. [5] Outcomes other than equality\n are resolved consistently, but are not otherwise defined. [6]\n\n* Most other objects of built-in types compare unequal unless they are\n the same object; the choice whether one object is considered smaller\n or larger than another one is made arbitrarily but consistently\n within one execution of a program.\n\nThe operators ``in`` and ``not in`` test for collection membership.\n``x in s`` evaluates to true if *x* is a member of the collection *s*,\nand false otherwise. ``x not in s`` returns the negation of ``x in\ns``. The collection membership test has traditionally been bound to\nsequences; an object is a member of a collection if the collection is\na sequence and contains an element equal to that object. However, it\nmake sense for many other object types to support membership tests\nwithout being a sequence. In particular, dictionaries (for keys) and\nsets support membership testing.\n\nFor the list and tuple types, ``x in y`` is true if and only if there\nexists an index *i* such that ``x == y[i]`` is true.\n\nFor the Unicode and string types, ``x in y`` is true if and only if\n*x* is a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nNote, *x* and *y* need not be the same type; consequently, ``u\'ab\' in\n\'abc\'`` will return ``True``. Empty strings are always considered to\nbe a substring of any other string, so ``"" in "abc"`` will return\n``True``.\n\nChanged in version 2.3: Previously, *x* was required to be a string of\nlength ``1``.\n\nFor user-defined classes which define the ``__contains__()`` method,\n``x in y`` is true if and only if ``y.__contains__(x)`` is true.\n\nFor user-defined classes which do not define ``__contains__()`` but do\ndefine ``__iter__()``, ``x in y`` is true if some value ``z`` with ``x\n== z`` is produced while iterating over ``y``. If an exception is\nraised during the iteration, it is as if ``in`` raised that exception.\n\nLastly, the old-style iteration protocol is tried: if a class defines\n``__getitem__()``, ``x in y`` is true if and only if there is a non-\nnegative integer index *i* such that ``x == y[i]``, and all lower\ninteger indices do not raise ``IndexError`` exception. (If any other\nexception is raised, it is as if ``in`` raised that exception).\n\nThe operator ``not in`` is defined to have the inverse true value of\n``in``.\n\nThe operators ``is`` and ``is not`` test for object identity: ``x is\ny`` is true if and only if *x* and *y* are the same object. ``x is\nnot y`` yields the inverse truth value. [7]\n',
39 'formatstrings': u'\nFormat String Syntax\n********************\n\nThe ``str.format()`` method and the ``Formatter`` class share the same\nsyntax for format strings (although in the case of ``Formatter``,\nsubclasses can define their own format string syntax).\n\nFormat strings contain "replacement fields" surrounded by curly braces\n``{}``. Anything that is not contained in braces is considered literal\ntext, which is copied unchanged to the output. If you need to include\na brace character in the literal text, it can be escaped by doubling:\n``{{`` and ``}}``.\n\nThe grammar for a replacement field is as follows:\n\n replacement_field ::= "{" [field_name] ["!" conversion] [":" format_spec] "}"\n field_name ::= arg_name ("." attribute_name | "[" element_index "]")*\n arg_name ::= [identifier | integer]\n attribute_name ::= identifier\n element_index ::= integer | index_string\n index_string ::= <any source character except "]"> +\n conversion ::= "r" | "s"\n format_spec ::= <described in the next section>\n\nIn less formal terms, the replacement field can start with a\n*field_name* that specifies the object whose value is to be formatted\nand inserted into the output instead of the replacement field. The\n*field_name* is optionally followed by a *conversion* field, which is\npreceded by an exclamation point ``\'!\'``, and a *format_spec*, which\nis preceded by a colon ``\':\'``. These specify a non-default format\nfor the replacement value.\n\nSee also the *Format Specification Mini-Language* section.\n\nThe *field_name* itself begins with an *arg_name* that is either\neither a number or a keyword. If it\'s a number, it refers to a\npositional argument, and if it\'s a keyword, it refers to a named\nkeyword argument. If the numerical arg_names in a format string are\n0, 1, 2, ... in sequence, they can all be omitted (not just some) and\nthe numbers 0, 1, 2, ... will be automatically inserted in that order.\nThe *arg_name* can be followed by any number of index or attribute\nexpressions. An expression of the form ``\'.name\'`` selects the named\nattribute using ``getattr()``, while an expression of the form\n``\'[index]\'`` does an index lookup using ``__getitem__()``.\n\nChanged in version 2.7: The positional argument specifiers can be\nomitted, so ``\'{} {}\'`` is equivalent to ``\'{0} {1}\'``.\n\nSome simple format string examples:\n\n "First, thou shalt count to {0}" # References first positional argument\n "Bring me a {}" # Implicitly references the first positional argument\n "From {} to {}" # Same as "From {0} to {1}"\n "My quest is {name}" # References keyword argument \'name\'\n "Weight in tons {0.weight}" # \'weight\' attribute of first positional arg\n "Units destroyed: {players[0]}" # First element of keyword argument \'players\'.\n\nThe *conversion* field causes a type coercion before formatting.\nNormally, the job of formatting a value is done by the\n``__format__()`` method of the value itself. However, in some cases\nit is desirable to force a type to be formatted as a string,\noverriding its own definition of formatting. By converting the value\nto a string before calling ``__format__()``, the normal formatting\nlogic is bypassed.\n\nTwo conversion flags are currently supported: ``\'!s\'`` which calls\n``str()`` on the value, and ``\'!r\'`` which calls ``repr()``.\n\nSome examples:\n\n "Harold\'s a clever {0!s}" # Calls str() on the argument first\n "Bring out the holy {name!r}" # Calls repr() on the argument first\n\nThe *format_spec* field contains a specification of how the value\nshould be presented, including such details as field width, alignment,\npadding, decimal precision and so on. Each value type can define its\nown "formatting mini-language" or interpretation of the *format_spec*.\n\nMost built-in types support a common formatting mini-language, which\nis described in the next section.\n\nA *format_spec* field can also include nested replacement fields\nwithin it. These nested replacement fields can contain only a field\nname; conversion flags and format specifications are not allowed. The\nreplacement fields within the format_spec are substituted before the\n*format_spec* string is interpreted. This allows the formatting of a\nvalue to be dynamically specified.\n\nSee the *Format examples* section for some examples.\n\n\nFormat Specification Mini-Language\n==================================\n\n"Format specifications" are used within replacement fields contained\nwithin a format string to define how individual values are presented\n(see *Format String Syntax*). They can also be passed directly to the\nbuilt-in ``format()`` function. Each formattable type may define how\nthe format specification is to be interpreted.\n\nMost built-in types implement the following options for format\nspecifications, although some of the formatting options are only\nsupported by the numeric types.\n\nA general convention is that an empty format string (``""``) produces\nthe same result as if you had called ``str()`` on the value. A non-\nempty format string typically modifies the result.\n\nThe general form of a *standard format specifier* is:\n\n format_spec ::= [[fill]align][sign][#][0][width][,][.precision][type]\n fill ::= <a character other than \'}\'>\n align ::= "<" | ">" | "=" | "^"\n sign ::= "+" | "-" | " "\n width ::= integer\n precision ::= integer\n type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"\n\nThe *fill* character can be any character other than \'{\' or \'}\'. The\npresence of a fill character is signaled by the character following\nit, which must be one of the alignment options. If the second\ncharacter of *format_spec* is not a valid alignment option, then it is\nassumed that both the fill character and the alignment option are\nabsent.\n\nThe meaning of the various alignment options is as follows:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'<\'`` | Forces the field to be left-aligned within the available |\n | | space (this is the default for most objects). |\n +-----------+------------------------------------------------------------+\n | ``\'>\'`` | Forces the field to be right-aligned within the available |\n | | space (this is the default for numbers). |\n +-----------+------------------------------------------------------------+\n | ``\'=\'`` | Forces the padding to be placed after the sign (if any) |\n | | but before the digits. This is used for printing fields |\n | | in the form \'+000000120\'. This alignment option is only |\n | | valid for numeric types. |\n +-----------+------------------------------------------------------------+\n | ``\'^\'`` | Forces the field to be centered within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n\nNote that unless a minimum field width is defined, the field width\nwill always be the same size as the data to fill it, so that the\nalignment option has no meaning in this case.\n\nThe *sign* option is only valid for number types, and can be one of\nthe following:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'+\'`` | indicates that a sign should be used for both positive as |\n | | well as negative numbers. |\n +-----------+------------------------------------------------------------+\n | ``\'-\'`` | indicates that a sign should be used only for negative |\n | | numbers (this is the default behavior). |\n +-----------+------------------------------------------------------------+\n | space | indicates that a leading space should be used on positive |\n | | numbers, and a minus sign on negative numbers. |\n +-----------+------------------------------------------------------------+\n\nThe ``\'#\'`` option is only valid for integers, and only for binary,\noctal, or hexadecimal output. If present, it specifies that the\noutput will be prefixed by ``\'0b\'``, ``\'0o\'``, or ``\'0x\'``,\nrespectively.\n\nThe ``\',\'`` option signals the use of a comma for a thousands\nseparator. For a locale aware separator, use the ``\'n\'`` integer\npresentation type instead.\n\nChanged in version 2.7: Added the ``\',\'`` option (see also **PEP\n378**).\n\n*width* is a decimal integer defining the minimum field width. If not\nspecified, then the field width will be determined by the content.\n\nIf the *width* field is preceded by a zero (``\'0\'``) character, this\nenables zero-padding. This is equivalent to an *alignment* type of\n``\'=\'`` and a *fill* character of ``\'0\'``.\n\nThe *precision* is a decimal number indicating how many digits should\nbe displayed after the decimal point for a floating point value\nformatted with ``\'f\'`` and ``\'F\'``, or before and after the decimal\npoint for a floating point value formatted with ``\'g\'`` or ``\'G\'``.\nFor non-number types the field indicates the maximum field size - in\nother words, how many characters will be used from the field content.\nThe *precision* is not allowed for integer values.\n\nFinally, the *type* determines how the data should be presented.\n\nThe available string presentation types are:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'s\'`` | String format. This is the default type for strings and |\n | | may be omitted. |\n +-----------+------------------------------------------------------------+\n | None | The same as ``\'s\'``. |\n +-----------+------------------------------------------------------------+\n\nThe available integer presentation types are:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'b\'`` | Binary format. Outputs the number in base 2. |\n +-----------+------------------------------------------------------------+\n | ``\'c\'`` | Character. Converts the integer to the corresponding |\n | | unicode character before printing. |\n +-----------+------------------------------------------------------------+\n | ``\'d\'`` | Decimal Integer. Outputs the number in base 10. |\n +-----------+------------------------------------------------------------+\n | ``\'o\'`` | Octal format. Outputs the number in base 8. |\n +-----------+------------------------------------------------------------+\n | ``\'x\'`` | Hex format. Outputs the number in base 16, using lower- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'X\'`` | Hex format. Outputs the number in base 16, using upper- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'d\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | None | The same as ``\'d\'``. |\n +-----------+------------------------------------------------------------+\n\nIn addition to the above presentation types, integers can be formatted\nwith the floating point presentation types listed below (except\n``\'n\'`` and None). When doing so, ``float()`` is used to convert the\ninteger to a floating point number before formatting.\n\nThe available presentation types for floating point and decimal values\nare:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'e\'`` | Exponent notation. Prints the number in scientific |\n | | notation using the letter \'e\' to indicate the exponent. |\n +-----------+------------------------------------------------------------+\n | ``\'E\'`` | Exponent notation. Same as ``\'e\'`` except it uses an upper |\n | | case \'E\' as the separator character. |\n +-----------+------------------------------------------------------------+\n | ``\'f\'`` | Fixed point. Displays the number as a fixed-point number. |\n +-----------+------------------------------------------------------------+\n | ``\'F\'`` | Fixed point. Same as ``\'f\'``. |\n +-----------+------------------------------------------------------------+\n | ``\'g\'`` | General format. For a given precision ``p >= 1``, this |\n | | rounds the number to ``p`` significant digits and then |\n | | formats the result in either fixed-point format or in |\n | | scientific notation, depending on its magnitude. The |\n | | precise rules are as follows: suppose that the result |\n | | formatted with presentation type ``\'e\'`` and precision |\n | | ``p-1`` would have exponent ``exp``. Then if ``-4 <= exp |\n | | < p``, the number is formatted with presentation type |\n | | ``\'f\'`` and precision ``p-1-exp``. Otherwise, the number |\n | | is formatted with presentation type ``\'e\'`` and precision |\n | | ``p-1``. In both cases insignificant trailing zeros are |\n | | removed from the significand, and the decimal point is |\n | | also removed if there are no remaining digits following |\n | | it. Positive and negative infinity, positive and negative |\n | | zero, and nans, are formatted as ``inf``, ``-inf``, ``0``, |\n | | ``-0`` and ``nan`` respectively, regardless of the |\n | | precision. A precision of ``0`` is treated as equivalent |\n | | to a precision of ``1``. |\n +-----------+------------------------------------------------------------+\n | ``\'G\'`` | General format. Same as ``\'g\'`` except switches to ``\'E\'`` |\n | | if the number gets too large. The representations of |\n | | infinity and NaN are uppercased, too. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'g\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | ``\'%\'`` | Percentage. Multiplies the number by 100 and displays in |\n | | fixed (``\'f\'``) format, followed by a percent sign. |\n +-----------+------------------------------------------------------------+\n | None | The same as ``\'g\'``. |\n +-----------+------------------------------------------------------------+\n\n\nFormat examples\n===============\n\nThis section contains examples of the new format syntax and comparison\nwith the old ``%``-formatting.\n\nIn most of the cases the syntax is similar to the old\n``%``-formatting, with the addition of the ``{}`` and with ``:`` used\ninstead of ``%``. For example, ``\'%03.2f\'`` can be translated to\n``\'{:03.2f}\'``.\n\nThe new format syntax also supports new and different options, shown\nin the follow examples.\n\nAccessing arguments by position:\n\n >>> \'{0}, {1}, {2}\'.format(\'a\', \'b\', \'c\')\n \'a, b, c\'\n >>> \'{}, {}, {}\'.format(\'a\', \'b\', \'c\') # 2.7+ only\n \'a, b, c\'\n >>> \'{2}, {1}, {0}\'.format(\'a\', \'b\', \'c\')\n \'c, b, a\'\n >>> \'{2}, {1}, {0}\'.format(*\'abc\') # unpacking argument sequence\n \'c, b, a\'\n >>> \'{0}{1}{0}\'.format(\'abra\', \'cad\') # arguments\' indices can be repeated\n \'abracadabra\'\n\nAccessing arguments by name:\n\n >>> \'Coordinates: {latitude}, {longitude}\'.format(latitude=\'37.24N\', longitude=\'-115.81W\')\n \'Coordinates: 37.24N, -115.81W\'\n >>> coord = {\'latitude\': \'37.24N\', \'longitude\': \'-115.81W\'}\n >>> \'Coordinates: {latitude}, {longitude}\'.format(**coord)\n \'Coordinates: 37.24N, -115.81W\'\n\nAccessing arguments\' attributes:\n\n >>> c = 3-5j\n >>> (\'The complex number {0} is formed from the real part {0.real} \'\n ... \'and the imaginary part {0.imag}.\').format(c)\n \'The complex number (3-5j) is formed from the real part 3.0 and the imaginary part -5.0.\'\n >>> class Point(object):\n ... def __init__(self, x, y):\n ... self.x, self.y = x, y\n ... def __str__(self):\n ... return \'Point({self.x}, {self.y})\'.format(self=self)\n ...\n >>> str(Point(4, 2))\n \'Point(4, 2)\'\n\nAccessing arguments\' items:\n\n >>> coord = (3, 5)\n >>> \'X: {0[0]}; Y: {0[1]}\'.format(coord)\n \'X: 3; Y: 5\'\n\nReplacing ``%s`` and ``%r``:\n\n >>> "repr() shows quotes: {!r}; str() doesn\'t: {!s}".format(\'test1\', \'test2\')\n "repr() shows quotes: \'test1\'; str() doesn\'t: test2"\n\nAligning the text and specifying a width:\n\n >>> \'{:<30}\'.format(\'left aligned\')\n \'left aligned \'\n >>> \'{:>30}\'.format(\'right aligned\')\n \' right aligned\'\n >>> \'{:^30}\'.format(\'centered\')\n \' centered \'\n >>> \'{:*^30}\'.format(\'centered\') # use \'*\' as a fill char\n \'***********centered***********\'\n\nReplacing ``%+f``, ``%-f``, and ``% f`` and specifying a sign:\n\n >>> \'{:+f}; {:+f}\'.format(3.14, -3.14) # show it always\n \'+3.140000; -3.140000\'\n >>> \'{: f}; {: f}\'.format(3.14, -3.14) # show a space for positive numbers\n \' 3.140000; -3.140000\'\n >>> \'{:-f}; {:-f}\'.format(3.14, -3.14) # show only the minus -- same as \'{:f}; {:f}\'\n \'3.140000; -3.140000\'\n\nReplacing ``%x`` and ``%o`` and converting the value to different\nbases:\n\n >>> # format also supports binary numbers\n >>> "int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}".format(42)\n \'int: 42; hex: 2a; oct: 52; bin: 101010\'\n >>> # with 0x, 0o, or 0b as prefix:\n >>> "int: {0:d}; hex: {0:#x}; oct: {0:#o}; bin: {0:#b}".format(42)\n \'int: 42; hex: 0x2a; oct: 0o52; bin: 0b101010\'\n\nUsing the comma as a thousands separator:\n\n >>> \'{:,}\'.format(1234567890)\n \'1,234,567,890\'\n\nExpressing a percentage:\n\n >>> points = 19.5\n >>> total = 22\n >>> \'Correct answers: {:.2%}.\'.format(points/total)\n \'Correct answers: 88.64%\'\n\nUsing type-specific formatting:\n\n >>> import datetime\n >>> d = datetime.datetime(2010, 7, 4, 12, 15, 58)\n >>> \'{:%Y-%m-%d %H:%M:%S}\'.format(d)\n \'2010-07-04 12:15:58\'\n\nNesting arguments and more complex examples:\n\n >>> for align, text in zip(\'<^>\', [\'left\', \'center\', \'right\']):\n ... \'{0:{fill}{align}16}\'.format(text, fill=align, align=align)\n ...\n \'left<<<<<<<<<<<<\'\n \'^^^^^center^^^^^\'\n \'>>>>>>>>>>>right\'\n >>>\n >>> octets = [192, 168, 0, 1]\n >>> \'{:02X}{:02X}{:02X}{:02X}\'.format(*octets)\n \'C0A80001\'\n >>> int(_, 16)\n 3232235521\n >>>\n >>> width = 5\n >>> for num in range(5,12):\n ... for base in \'dXob\':\n ... print \'{0:{width}{base}}\'.format(num, base=base, width=width),\n ... print\n ...\n 5 5 5 101\n 6 6 6 110\n 7 7 7 111\n 8 8 10 1000\n 9 9 11 1001\n 10 A 12 1010\n 11 B 13 1011\n',
47 'in': u'\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation. Also unlike C, expressions like ``a < b < c`` have the\ninterpretation that is conventional in mathematics:\n\n comparison ::= or_expr ( comp_operator or_expr )*\n comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "<>" | "!="\n | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: ``True`` or ``False``.\n\nComparisons can be chained arbitrarily, e.g., ``x < y <= z`` is\nequivalent to ``x < y and y <= z``, except that ``y`` is evaluated\nonly once (but in both cases ``z`` is not evaluated at all when ``x <\ny`` is found to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y\nopN z`` is equivalent to ``a op1 b and b op2 c and ... y opN z``,\nexcept that each expression is evaluated at most once.\n\nNote that ``a op1 b op2 c`` doesn\'t imply any kind of comparison\nbetween *a* and *c*, so that, e.g., ``x < y > z`` is perfectly legal\n(though perhaps not pretty).\n\nThe forms ``<>`` and ``!=`` are equivalent; for consistency with C,\n``!=`` is preferred; where ``!=`` is mentioned below ``<>`` is also\naccepted. The ``<>`` spelling is considered obsolescent.\n\nThe operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare\nthe values of two objects. The objects need not have the same type.\nIf both are numbers, they are converted to a common type. Otherwise,\nobjects of different types *always* compare unequal, and are ordered\nconsistently but arbitrarily. You can control comparison behavior of\nobjects of non-built-in types by defining a ``__cmp__`` method or rich\ncomparison methods like ``__gt__``, described in section *Special\nmethod names*.\n\n(This unusual definition of comparison was used to simplify the\ndefinition of operations like sorting and the ``in`` and ``not in``\noperators. In the future, the comparison rules for objects of\ndifferent types are likely to change.)\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n Unicode and 8-bit strings are fully interoperable in this behavior.\n [4]\n\n* Tuples and lists are compared lexicographically using comparison of\n corresponding elements. This means that to compare equal, each\n element must compare equal and the two sequences must be of the same\n type and have the same length.\n\n If not equal, the sequences are ordered the same as their first\n differing elements. For example, ``cmp([1,2,x], [1,2,y])`` returns\n the same as ``cmp(x,y)``. If the corresponding element does not\n exist, the shorter sequence is ordered first (for example, ``[1,2] <\n [1,2,3]``).\n\n* Mappings (dictionaries) compare equal if and only if their sorted\n (key, value) lists compare equal. [5] Outcomes other than equality\n are resolved consistently, but are not otherwise defined. [6]\n\n* Most other objects of built-in types compare unequal unless they are\n the same object; the choice whether one object is considered smaller\n or larger than another one is made arbitrarily but consistently\n within one execution of a program.\n\nThe operators ``in`` and ``not in`` test for collection membership.\n``x in s`` evaluates to true if *x* is a member of the collection *s*,\nand false otherwise. ``x not in s`` returns the negation of ``x in\ns``. The collection membership test has traditionally been bound to\nsequences; an object is a member of a collection if the collection is\na sequence and contains an element equal to that object. However, it\nmake sense for many other object types to support membership tests\nwithout being a sequence. In particular, dictionaries (for keys) and\nsets support membership testing.\n\nFor the list and tuple types, ``x in y`` is true if and only if there\nexists an index *i* such that ``x == y[i]`` is true.\n\nFor the Unicode and string types, ``x in y`` is true if and only if\n*x* is a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nNote, *x* and *y* need not be the same type; consequently, ``u\'ab\' in\n\'abc\'`` will return ``True``. Empty strings are always considered to\nbe a substring of any other string, so ``"" in "abc"`` will return\n``True``.\n\nChanged in version 2.3: Previously, *x* was required to be a string of\nlength ``1``.\n\nFor user-defined classes which define the ``__contains__()`` method,\n``x in y`` is true if and only if ``y.__contains__(x)`` is true.\n\nFor user-defined classes which do not define ``__contains__()`` but do\ndefine ``__iter__()``, ``x in y`` is true if some value ``z`` with ``x\n== z`` is produced while iterating over ``y``. If an exception is\nraised during the iteration, it is as if ``in`` raised that exception.\n\nLastly, the old-style iteration protocol is tried: if a class defines\n``__getitem__()``, ``x in y`` is true if and only if there is a non-\nnegative integer index *i* such that ``x == y[i]``, and all lower\ninteger indices do not raise ``IndexError`` exception. (If any other\nexception is raised, it is as if ``in`` raised that exception).\n\nThe operator ``not in`` is defined to have the inverse true value of\n``in``.\n\nThe operators ``is`` and ``is not`` test for object identity: ``x is\ny`` is true if and only if *x* and *y* are the same object. ``x is\nnot y`` yields the inverse truth value. [7]\n',
48 'integers': u'\nInteger and long integer literals\n*********************************\n\nInteger and long integer literals are described by the following\nlexical definitions:\n\n longinteger ::= integer ("l" | "L")\n integer ::= decimalinteger | octinteger | hexinteger | bininteger\n decimalinteger ::= nonzerodigit digit* | "0"\n octinteger ::= "0" ("o" | "O") octdigit+ | "0" octdigit+\n hexinteger ::= "0" ("x" | "X") hexdigit+\n bininteger ::= "0" ("b" | "B") bindigit+\n nonzerodigit ::= "1"..."9"\n octdigit ::= "0"..."7"\n bindigit ::= "0" | "1"\n hexdigit ::= digit | "a"..."f" | "A"..."F"\n\nAlthough both lower case ``\'l\'`` and upper case ``\'L\'`` are allowed as\nsuffix for long integers, it is strongly recommended to always use\n``\'L\'``, since the letter ``\'l\'`` looks too much like the digit\n``\'1\'``.\n\nPlain integer literals that are above the largest representable plain\ninteger (e.g., 2147483647 when using 32-bit arithmetic) are accepted\nas if they were long integers instead. [1] There is no limit for long\ninteger literals apart from what can be stored in available memory.\n\nSome examples of plain integer literals (first row) and long integer\nliterals (second and third rows):\n\n 7 2147483647 0177\n 3L 79228162514264337593543950336L 0377L 0x100000000L\n 79228162514264337593543950336 0xdeadbeef\n',
63 'shifting': u'\nShifting operations\n*******************\n\nThe shifting operations have lower priority than the arithmetic\noperations:\n\n shift_expr ::= a_expr | shift_expr ( "<<" | ">>" ) a_expr\n\nThese operators accept plain or long integers as arguments. The\narguments are converted to a common type. They shift the first\nargument to the left or right by the number of bits given by the\nsecond argument.\n\nA right shift by *n* bits is defined as division by ``pow(2, n)``. A\nleft shift by *n* bits is defined as multiplication with ``pow(2,\nn)``. Negative shift counts raise a ``ValueError`` exception.\n\nNote: In the current implementation, the right-hand operand is required to\n be at most ``sys.maxsize``. If the right-hand operand is larger\n than ``sys.maxsize`` an ``OverflowError`` exception is raised.\n',
64 'slicings': u'\nSlicings\n********\n\nA slicing selects a range of items in a sequence object (e.g., a\nstring, tuple or list). Slicings may be used as expressions or as\ntargets in assignment or ``del`` statements. The syntax for a\nslicing:\n\n slicing ::= simple_slicing | extended_slicing\n simple_slicing ::= primary "[" short_slice "]"\n extended_slicing ::= primary "[" slice_list "]"\n slice_list ::= slice_item ("," slice_item)* [","]\n slice_item ::= expression | proper_slice | ellipsis\n proper_slice ::= short_slice | long_slice\n short_slice ::= [lower_bound] ":" [upper_bound]\n long_slice ::= short_slice ":" [stride]\n lower_bound ::= expression\n upper_bound ::= expression\n stride ::= expression\n ellipsis ::= "..."\n\nThere is ambiguity in the formal syntax here: anything that looks like\nan expression list also looks like a slice list, so any subscription\ncan be interpreted as a slicing. Rather than further complicating the\nsyntax, this is disambiguated by defining that in this case the\ninterpretation as a subscription takes priority over the\ninterpretation as a slicing (this is the case if the slice list\ncontains no proper slice nor ellipses). Similarly, when the slice\nlist has exactly one short slice and no trailing comma, the\ninterpretation as a simple slicing takes priority over that as an\nextended slicing.\n\nThe semantics for a simple slicing are as follows. The primary must\nevaluate to a sequence object. The lower an
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/Modules/
H A Dsre.h85 SRE_TOLOWER_HOOK lower; member in struct:__anon3172
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.2/Objects/
H A Dunicodectype.c27 const Py_UNICODE lower; member in struct:__anon3228
167 int delta = ctype->lower;
/device/linaro/bootloader/edk2/AppPkg/Applications/Python/Python-2.7.2/Python/
H A DPython-ast.c288 "lower",
1979 Slice(expr_ty lower, expr_ty upper, expr_ty step, PyArena *arena) argument
1986 p->v.Slice.lower = lower;
2960 value = ast2obj_expr(o->v.Slice.lower);
2962 if (PyObject_SetAttrString(result, "lower", value) == -1)
5834 expr_ty lower; local
5838 if (PyObject_HasAttrString(obj, "lower")) {
5840 tmp = PyObject_GetAttrString(obj, "lower");
5842 res = obj2ast_expr(tmp, &lower, aren
[all...]
H A Dast.c1520 expr_ty lower = NULL, upper = NULL, step = NULL; local
1543 lower = ast_for_expr(c, ch);
1544 if (!lower)
1595 return Slice(lower, upper, step, c->c_arena);
/device/linaro/bootloader/edk2/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/
H A Doniguruma.h445 #define ONIG_SYN_OP_BRACE_INTERVAL (1U<<8) /* {lower,upper} */
446 #define ONIG_SYN_OP_ESC_BRACE_INTERVAL (1U<<9) /* \{lower,upper\} */
639 int lower; member in struct:__anon6516
H A Dregcomp.c654 entry_repeat_range(regex_t* reg, int id, int lower, int upper) argument
680 p[id].lower = lower;
700 r = entry_repeat_range(reg, num_repeat, qn->lower, qn->upper);
755 return SIZE_OP_ANYCHAR_STAR_PEEK_NEXT + tlen * qn->lower + cklen;
757 return SIZE_OP_ANYCHAR_STAR + tlen * qn->lower + cklen;
766 if (infinite && qn->lower <= 1) {
768 if (qn->lower == 1)
776 if (qn->lower == 0)
791 if (qn->lower
[all...]
H A Dregenc.c577 const UChar*end ARG_UNUSED, UChar* lower)
579 *lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(**p);
582 return 1; /* return byte length of converted char to lower */
664 UChar* lower)
670 *lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p);
679 *lower++ = *p++;
682 return len; /* return byte length of converted to lower char */
576 onigenc_ascii_mbc_case_fold(OnigCaseFoldType flag ARG_UNUSED, const UChar** p, const UChar*end ARG_UNUSED, UChar* lower) argument
662 onigenc_mbn_mbc_case_fold(OnigEncoding enc, OnigCaseFoldType flag ARG_UNUSED, const UChar** pp, const UChar* end ARG_UNUSED, UChar* lower) argument
H A Dregparse.c1354 node_new_quantifier(int lower, int upper, int by_number) argument
1362 NQTFR(node)->lower = lower;
2166 if (q->lower == 0) {
2170 else if (q->lower == 1) {
2175 if (q->lower == 0) {
2179 else if (q->lower == 1) {
2224 p->lower = 0; p->upper = REPEAT_INFINITE; p->greedy = 1;
2228 p->lower = 0; p->upper = REPEAT_INFINITE; p->greedy = 0;
2232 p->lower
2297 int lower; member in struct:__anon6542::__anon6543::__anon6544
[all...]
H A Dregparse.h175 int lower; member in struct:__anon6551

Completed in 658 milliseconds