Lines Matching +full:shared +full:- +full:library +full:- +full:atoms
36 coercion rules listed at :ref:`coercion-rules`. If both arguments are standard
55 Atoms chapter
60 Atoms are the most basic elements of expressions. The simplest atoms are
62 brackets or braces are also categorized syntactically as atoms. The syntax for
63 atoms is:
72 .. _atom-identifiers:
75 -------------------
109 .. _atom-literals:
112 --------
141 -------------------
166 required --- allowing unparenthesized "nothing" in expressions would cause
173 -------------
198 comma-separated list of expressions is supplied, its elements are evaluated from
211 ----------------------------------
243 ---------------------
272 -------------------
289 If a comma-separated sequence of key/datum pairs is given, they are evaluated
313 ------------
325 either a sequence of expressions or a comprehension. When a comma-separated
334 .. _string-conversions:
337 ------------------
343 single: back-quotes
356 valid Python expression which can be passed to the built-in function
374 The built-in function :func:`repr` performs exactly the same conversion in its
375 argument as enclosing it in parentheses and reverse quotes does. The built-in
376 function :func:`str` performs a similar but more user-friendly conversion.
382 -----------------
424 Generator-iterator methods
465 raised. If the generator function does not catch the passed-in exception, or
511 :pep:`342` - Coroutines via Enhanced Generators
530 .. _attribute-references:
533 --------------------
558 -------------
586 (so that, e.g., ``x[-1]`` selects the last item of ``x``.) The resulting value
602 --------
663 item is the built-in ``Ellipsis`` object. The conversion of a proper slice is a
678 -----
703 The primary must evaluate to a callable object (user-defined functions, built-in
704 functions, methods of built-in objects, class objects, methods of class
722 value will be shared by all calls that don't specify an argument value for the
728 .. impl-detail::
730 An implementation may provide built-in functions whose positional parameters
761 (and the ``**expression`` argument, if any -- see below). So::
797 If it is---
799 a user-defined function:
802 triple: user-defined; function; call
803 object: user-defined function
812 a built-in function or method:
815 pair: built-in function; call
817 pair: built-in method; call
818 object: built-in method
819 object: built-in function
823 The result is up to the interpreter; see :ref:`built-in-funcs` for the
824 descriptions of built-in functions and methods.
839 The corresponding user-defined function is called, with an argument list that is
865 for the operands): ``-1**2`` results in ``-1``.
867 The power operator has the same semantics as the built-in :func:`pow` function,
876 example, ``10**2`` returns ``100``, but ``10**-2`` returns ``0.01``. (This last
897 u_expr: `power` | "-" `u_expr` | "+" `u_expr` | "~" `u_expr`
903 The unary ``-`` (minus) operator yields the negation of its numeric argument.
913 ``-(x+1)``. It only applies to integral numbers.
929 that some of these operations also apply to certain non-numeric types. Apart
936 a_expr: `m_expr` | `a_expr` "+" `m_expr` | `a_expr` "-" `m_expr`
970 connected with the built-in function :func:`divmod`: ``divmod(x, y) == (x/y,
973 ``floor(x/y) - 1`` [#]_.
978 Python Library Reference, section :ref:`string-formatting`.
994 The ``-`` (subtraction) operator yields the difference of its arguments. The
1022 In the current implementation, the right-hand operand is required
1023 to be at most :attr:`sys.maxsize`. If the right-hand operand is larger than
1101 -----------------
1137 have a sensible definition of object value and value-based equality. Such
1139 of built-in types have done that.
1142 built-in types.
1144 * Numbers of built-in numeric types (:ref:`typesnumeric`) and of the standard
1145 library types :class:`fractions.Fraction` and :class:`decimal.Decimal` can be
1153 result of the built-in function :func:`ord`) of their characters. [#]_
1154 When comparing an 8-bit string and a Unicode string, the 8-bit string
1171 reflexive. For non-reflexive elements, the result is different than for
1174 Lexicographical comparison between built-in collections works as follows:
1176 - For two collections to compare equal, they must be of the same type, have
1181 - Collections are ordered the same as their
1194 * Most other objects of built-in types compare unequal unless they are the same
1199 User-defined classes that customize their comparison behavior should follow
1219 The following (non-exhaustive) examples illustrate that:
1247 .. _membership-test-details:
1250 --------------------------
1254 ``x not in s`` returns the negation of ``x in s``. All built-in sequences and
1261 substring of *y*. An equivalent test is ``y.find(x) != -1``. Empty strings are
1265 For user-defined classes which define the :meth:`__contains__` method, ``x in
1269 For user-defined classes which do not define :meth:`__contains__` but do define
1274 Lastly, the old-style iteration protocol is tried: if a class defines
1275 :meth:`__getitem__`, ``x in y`` is ``True`` if and only if there is a non-negative
1299 --------------------
1436 assignment, the right-hand side is evaluated before the left-hand side.
1444 expr1 + expr2 * (expr3 - expr4)
1449 .. _operator-summary:
1461 left to right --- see section :ref:`comparisons` --- and exponentiation, which
1464 +-----------------------------------------------+-------------------------------------+
1468 +-----------------------------------------------+-------------------------------------+
1469 | :keyword:`if` -- :keyword:`else` | Conditional expression |
1470 +-----------------------------------------------+-------------------------------------+
1472 +-----------------------------------------------+-------------------------------------+
1474 +-----------------------------------------------+-------------------------------------+
1476 +-----------------------------------------------+-------------------------------------+
1480 +-----------------------------------------------+-------------------------------------+
1482 +-----------------------------------------------+-------------------------------------+
1484 +-----------------------------------------------+-------------------------------------+
1486 +-----------------------------------------------+-------------------------------------+
1488 +-----------------------------------------------+-------------------------------------+
1489 | ``+``, ``-`` | Addition and subtraction |
1490 +-----------------------------------------------+-------------------------------------+
1493 +-----------------------------------------------+-------------------------------------+
1494 | ``+x``, ``-x``, ``~x`` | Positive, negative, bitwise NOT |
1495 +-----------------------------------------------+-------------------------------------+
1497 +-----------------------------------------------+-------------------------------------+
1500 +-----------------------------------------------+-------------------------------------+
1505 +-----------------------------------------------+-------------------------------------+
1515 a Python float is an IEEE 754 double-precision number, in order that ``-1e-100 %
1516 1e100`` have the same sign as ``1e100``, the computed result is ``-1e-100 +
1519 first argument instead, and so returns ``-1e-100`` in this case. Which approach
1523 ``floor(x/y)`` to be one larger than ``(x-x%y)/y`` due to rounding. In such
1539 points. This may be counter-intuitive to humans. For example,
1552 .. [#] Due to automatic garbage-collection, free lists, and the dynamic nature of
1561 bitwise unary operator on its right, that is, ``2**-1`` is ``0.5``.