mirror of
https://github.com/python/cpython.git
synced 2025-07-23 19:25:40 +00:00
Forward-port r67624 and r67627.
This commit is contained in:
parent
c7d2b21cec
commit
2080ea5f4b
2 changed files with 1 additions and 8 deletions
|
@ -137,13 +137,6 @@ are always available. They are listed here in alphabetical order.
|
||||||
type hierarchy in :ref:`types`.
|
type hierarchy in :ref:`types`.
|
||||||
|
|
||||||
|
|
||||||
.. function:: cmp(x, y)
|
|
||||||
|
|
||||||
Compare the two objects *x* and *y* and return an integer according to the
|
|
||||||
outcome. The return value is negative if ``x < y``, zero if ``x == y`` and
|
|
||||||
strictly positive if ``x > y``.
|
|
||||||
|
|
||||||
|
|
||||||
.. function:: compile(source, filename, mode[, flags[, dont_inherit]])
|
.. function:: compile(source, filename, mode[, flags[, dont_inherit]])
|
||||||
|
|
||||||
Compile the *source* into a code or AST object. Code objects can be executed
|
Compile the *source* into a code or AST object. Code objects can be executed
|
||||||
|
|
|
@ -376,7 +376,7 @@ Here is a brief demonstration::
|
||||||
|
|
||||||
>>> basket = {'apple', 'orange', 'apple', 'pear', 'orange', 'banana'}
|
>>> basket = {'apple', 'orange', 'apple', 'pear', 'orange', 'banana'}
|
||||||
>>> print(basket)
|
>>> print(basket)
|
||||||
{'orange', 'bananna', 'pear', 'apple'}
|
{'orange', 'banana', 'pear', 'apple'}
|
||||||
>>> fruit = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana']
|
>>> fruit = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana']
|
||||||
>>> fruit = set(basket) # create a set without duplicates
|
>>> fruit = set(basket) # create a set without duplicates
|
||||||
>>> fruit
|
>>> fruit
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue