Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
c48d8340
Kaydet (Commit)
c48d8340
authored
Şub 01, 2009
tarafından
Mark Dickinson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #1717: documentation fixes related to the cmp removal.
üst
c008a176
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
36 deletions
+45
-36
collation_reverse.py
Doc/includes/sqlite3/collation_reverse.py
+6
-1
locale.rst
Doc/library/locale.rst
+5
-6
operator.rst
Doc/library/operator.rst
+3
-3
unittest.rst
Doc/library/unittest.rst
+10
-5
expressions.rst
Doc/reference/expressions.rst
+2
-2
modules.rst
Doc/tutorial/modules.rst
+19
-19
No files found.
Doc/includes/sqlite3/collation_reverse.py
Dosyayı görüntüle @
c48d8340
import
sqlite3
import
sqlite3
def
collate_reverse
(
string1
,
string2
):
def
collate_reverse
(
string1
,
string2
):
return
-
cmp
(
string1
,
string2
)
if
string1
==
string2
:
return
0
elif
string1
<
string2
:
return
1
else
:
return
-
1
con
=
sqlite3
.
connect
(
":memory:"
)
con
=
sqlite3
.
connect
(
":memory:"
)
con
.
create_collation
(
"reverse"
,
collate_reverse
)
con
.
create_collation
(
"reverse"
,
collate_reverse
)
...
...
Doc/library/locale.rst
Dosyayı görüntüle @
c48d8340
...
@@ -225,12 +225,11 @@ The :mod:`locale` module defines the following exception and functions:
...
@@ -225,12 +225,11 @@ The :mod:`locale` module defines the following exception and functions:
.. function:: strxfrm(string)
.. function:: strxfrm(string)
.. index:: builtin: cmp
Transforms a string to one that can be used in locale-aware
comparisons. For example, ``strxfrm(s1) < strxfrm(s2)`` is
Transforms a string to one that can be used for the built-in function
equivalent to ``strcoll(s1, s2) < 0``. This function can be used
:func:`cmp`, and still returns locale-aware results. This function can be used
when the same string is compared repeatedly, e.g. when collating a
when the same string is compared repeatedly, e.g. when collating a sequence of
sequence of strings.
strings.
.. function:: format(format, val[, grouping[, monetary]])
.. function:: format(format, val[, grouping[, monetary]])
...
...
Doc/library/operator.rst
Dosyayı görüntüle @
c48d8340
...
@@ -43,9 +43,9 @@ the rich comparison operators they support:
...
@@ -43,9 +43,9 @@ the rich comparison operators they support:
equivalent to ``a < b``, ``le(a, b)`` is equivalent to ``a <= b``, ``eq(a,
equivalent to ``a < b``, ``le(a, b)`` is equivalent to ``a <= b``, ``eq(a,
b)`` is equivalent to ``a == b``, ``ne(a, b)`` is equivalent to ``a != b``,
b)`` is equivalent to ``a == b``, ``ne(a, b)`` is equivalent to ``a != b``,
``gt(a, b)`` is equivalent to ``a > b`` and ``ge(a, b)`` is equivalent to ``a
``gt(a, b)`` is equivalent to ``a > b`` and ``ge(a, b)`` is equivalent to ``a
>= b``. Note that
unlike the built-in :func:`cmp`, these functions can
>= b``. Note that
these functions can return any value, which may
return any value, which may or may not be interpretable as a Boolean value.
or may not be interpretable as a Boolean value. See
See
:ref:`comparisons` for more information about rich comparisons.
:ref:`comparisons` for more information about rich comparisons.
The logical operations are also generally applicable to all objects, and support
The logical operations are also generally applicable to all objects, and support
...
...
Doc/library/unittest.rst
Dosyayı görüntüle @
c48d8340
...
@@ -327,8 +327,9 @@ will create a test suite that will run ``WidgetTestCase.testDefaultSize()`` and
...
@@ -327,8 +327,9 @@ will create a test suite that will run ``WidgetTestCase.testDefaultSize()`` and
``WidgetTestCase.testResize``. :class:`TestLoader` uses the ``'test'`` method
``WidgetTestCase.testResize``. :class:`TestLoader` uses the ``'test'`` method
name prefix to identify test methods automatically.
name prefix to identify test methods automatically.
Note that the order in which the various test cases will be run is determined by
Note that the order in which the various test cases will be run is
sorting the test function names with the built-in :func:`cmp` function.
determined by sorting the test function names with respect to the
built-in ordering for strings.
Often it is desirable to group suites of test cases together, so as to run tests
Often it is desirable to group suites of test cases together, so as to run tests
for the whole system at once. This is easy, since :class:`TestSuite` instances
for the whole system at once. This is easy, since :class:`TestSuite` instances
...
@@ -921,9 +922,13 @@ subclassing or assignment on an instance:
...
@@ -921,9 +922,13 @@ subclassing or assignment on an instance:
.. attribute:: TestLoader.sortTestMethodsUsing
.. attribute:: TestLoader.sortTestMethodsUsing
Function to be used to compare method names when sorting them in
Function to be used to compare method names when sorting them in
:meth:`getTestCaseNames` and all the :meth:`loadTestsFrom\*` methods. The
:meth:`getTestCaseNames` and all the :meth:`loadTestsFrom\*`
default value is the built-in :func:`cmp` function; the attribute can also be
methods. This should be a function that takes two arguments
set to :const:`None` to disable the sort.
``self`` and ``other``, and returns ``-1`` if ``self`` precedes
``other`` in the desired ordering, ``1`` if ``other`` precedes
``self``, and ``0`` if ``self`` and ``other`` are equal. The
default ordering is the built-in ordering for strings. This
attribute can also be set to :const:`None` to disable the sort.
.. attribute:: TestLoader.suiteClass
.. attribute:: TestLoader.suiteClass
...
...
Doc/reference/expressions.rst
Dosyayı görüntüle @
c48d8340
...
@@ -1022,8 +1022,8 @@ Comparison of objects of the same type depends on the type:
...
@@ -1022,8 +1022,8 @@ Comparison of objects of the same type depends on the type:
length.
length.
If not equal, the sequences are ordered the same as their first differing
If not equal, the sequences are ordered the same as their first differing
elements. For example, ``
cmp([1,2,x], [1,2,y])`` returns the sam
e as
elements. For example, ``
[1,2,x] <= [1,2,y]`` has the same valu
e as
``
cmp(x,y)
``. If the corresponding element does not exist, the shorter
``
x <= y
``. If the corresponding element does not exist, the shorter
sequence is ordered first (for example, ``[1,2] < [1,2,3]``).
sequence is ordered first (for example, ``[1,2] < [1,2,3]``).
* Mappings (dictionaries) compare equal if and only if their sorted ``(key,
* Mappings (dictionaries) compare equal if and only if their sorted ``(key,
...
...
Doc/tutorial/modules.rst
Dosyayı görüntüle @
c48d8340
...
@@ -317,25 +317,25 @@ want a list of those, they are defined in the standard module
...
@@ -317,25 +317,25 @@ want a list of those, they are defined in the standard module
>>> dir(builtins)
>>> dir(builtins)
['
ArithmeticError
', '
AssertionError
', '
AttributeError
', '
BaseException
', '
Buffer
['
ArithmeticError
', '
AssertionError
', '
AttributeError
', '
BaseException
', '
Buffer
Error
', '
DeprecationWarning
', '
EOFError
', '
Ellipsis
', '
EnvironmentError
', '
Excep
Error
', '
BytesWarning
', '
DeprecationWarning
', '
EOFError
', '
Ellipsis
', '
Environme
tion
', '
False
', '
FloatingPointError
', '
FutureWarning
', '
GeneratorExit
', '
IOError
ntError
', '
Exception
', '
False
', '
FloatingPointError
', '
FutureWarning
', '
Generato
', '
ImportError
', '
ImportWarning
', '
IndentationError
', '
IndexError
', '
KeyError
',
rExit
', '
IOError
', '
ImportError
', '
ImportWarning
', '
IndentationError
', '
IndexErr
'
KeyboardInterrupt
', '
LookupError
', '
MemoryError
', '
NameError
', '
None
', '
NotImp
or
', '
KeyError
', '
KeyboardInterrupt
', '
LookupError
', '
MemoryError
', '
NameError
',
lemented
', '
NotImplementedError
', '
OSError
', '
OverflowError
', '
PendingDeprecatio
'
None
', '
NotImplemented
', '
NotImplementedError
', '
OSError
', '
OverflowError
', '
P
nWarning
', '
ReferenceError
', '
RuntimeError
', '
RuntimeWarning
', '
StopIteration
',
endingDeprecationWarning
', '
ReferenceError
', '
RuntimeError
', '
RuntimeWarning
', '
'
SyntaxError
', '
SyntaxWarning
', '
SystemError
', '
SystemExit
', '
TabError
', '
True
',
StopIteration
', '
SyntaxError
', '
SyntaxWarning
', '
SystemError
', '
SystemExit
', '
Ta
'
TypeError
', '
UnboundLocalError
', '
UnicodeDecodeError
', '
UnicodeEncodeError
', '
bError
', '
True
', '
TypeError
', '
UnboundLocalError
', '
UnicodeDecodeError
', '
Unicod
UnicodeError
', '
UnicodeTranslateError
', '
UnicodeWarning
', '
UserWarning
', '
ValueE
eEncodeError
', '
UnicodeError
', '
UnicodeTranslateError
', '
UnicodeWarning
', '
UserW
rror
', '
Warning
', '
ZeroDivisionError
', '
__build_class__
', '
__debug__
', '
__doc__
'
arning
', '
ValueError
', '
Warning
', '
ZeroDivisionError
', '
__build_class__
', '
__deb
, '
__import__
', '
__name__
', '
abs
', '
all
', '
any
', '
basestring
', '
bin
', '
bool
', '
b
ug__
', '
__doc__
', '
__import__
', '
__name__
', '
__package__
', '
abs
', '
all
', '
any
',
uffer
', '
bytes
', '
chr
', '
chr8
', '
classmethod
', '
cmp
', '
compile
', '
complex
', '
cop
'
ascii
', '
bin
', '
bool
', '
bytearray
', '
bytes
', '
chr
', '
classmethod
', '
compile
', '
yright
', '
credits
', '
delattr
', '
dict
', '
dir
', '
divmod
', '
enumerate
', '
eval
', '
ex
complex
', '
copyright
', '
credits
', '
delattr
', '
dict
', '
dir
', '
divmod
', '
enumerate
ec
', '
exit
', '
filter
', '
float
', '
frozenset
', '
getattr
', '
globals
', '
hasattr
', '
h
', '
eval
', '
exec
', '
exit
', '
filter
', '
float
', '
format
', '
frozenset
', '
getattr
',
ash
', '
help
', '
hex
', '
id
', '
input
', '
int
', '
isinstance
', '
issubclass
', '
iter
', '
'
globals
', '
hasattr
', '
hash
', '
help
', '
hex
', '
id
', '
input
', '
int
', '
isinstance
',
len
', '
license
', '
list
', '
locals
', '
map
', '
max
', '
memoryview
', '
min
', '
next
', '
o
'
issubclass
', '
iter
', '
len
', '
license
', '
list
', '
locals
', '
map
', '
max
', '
memory
bject
', '
oct
', '
open
', '
ord
', '
pow
', '
print
', '
property
', '
quit
', '
range
', '
repr
view
', '
min
', '
next
', '
object
', '
oct
', '
open
', '
ord
', '
pow
', '
print
', '
property
'
', '
reversed
', '
round
', '
set
', '
setattr
', '
slice
', '
sorted
', '
staticmethod
', '
s
t
, '
quit
', '
range
', '
repr
', '
reversed
', '
round
', '
set
', '
setattr
', '
slice
', '
sor
t
r
', '
str8
', '
sum
', '
super
', '
trunc
', '
tuple
', '
type
', '
vars
', '
zip
']
ed
', '
staticmethod
', '
str
', '
sum
', '
super
', '
tuple
', '
type
', '
vars
', '
zip
']
.. _tut-packages:
.. _tut-packages:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment