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
e65fcde8
Kaydet (Commit)
e65fcde8
authored
Nis 27, 2017
tarafından
Marco Buttu
Kaydeden (comit)
Berker Peksag
Nis 27, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-27200: Fix several doctests (GH-604)
üst
6fde770e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
39 additions
and
24 deletions
+39
-24
email.compat32-message.rst
Doc/library/email.compat32-message.rst
+14
-10
functions.rst
Doc/library/functions.rst
+1
-1
ipaddress.rst
Doc/library/ipaddress.rst
+5
-3
reprlib.rst
Doc/library/reprlib.rst
+1
-0
shlex.rst
Doc/library/shlex.rst
+4
-2
urllib.parse.rst
Doc/library/urllib.parse.rst
+3
-0
3.2.rst
Doc/whatsnew/3.2.rst
+11
-8
No files found.
Doc/library/email.compat32-message.rst
Dosyayı görüntüle @
e65fcde8
...
@@ -660,10 +660,14 @@ Here are the methods of the :class:`Message` class:
...
@@ -660,10 +660,14 @@ Here are the methods of the :class:`Message` class:
.. testsetup::
.. testsetup::
>>> from email import message_from_binary_file
import email
>>> with open('Lib/test/test_email/data/msg_16.txt', 'rb') as f:
from email import message_from_binary_file
... msg = message_from_binary_file(f)
from os.path import join, dirname
>>> from email.iterators import _structure
lib_dir = dirname(dirname(email.__file__))
file_path = join(lib_dir, 'test/test_email/data/msg_16.txt')
with open(file_path, 'rb') as f:
msg = message_from_binary_file(f)
from email.iterators import _structure
.. doctest::
.. doctest::
...
@@ -686,7 +690,7 @@ Here are the methods of the :class:`Message` class:
...
@@ -686,7 +690,7 @@ Here are the methods of the :class:`Message` class:
.. doctest::
.. doctest::
>>> for part in msg.walk():
>>> for part in msg.walk():
... print(part.get_content_maintype() == 'multipart'
)
,
... print(part.get_content_maintype() == 'multipart',
... part.is_multipart())
... part.is_multipart())
True True
True True
False False
False False
...
@@ -698,11 +702,11 @@ Here are the methods of the :class:`Message` class:
...
@@ -698,11 +702,11 @@ Here are the methods of the :class:`Message` class:
>>> _structure(msg)
>>> _structure(msg)
multipart/report
multipart/report
text/plain
text/plain
message/delivery-status
message/delivery-status
text/plain
text/plain
text/plain
text/plain
message/rfc822
message/rfc822
text/plain
text/plain
Here the ``message`` parts are not ``multiparts``, but they do contain
Here the ``message`` parts are not ``multiparts``, but they do contain
subparts. ``is_multipart()`` returns ``True`` and ``walk`` descends
subparts. ``is_multipart()`` returns ``True`` and ``walk`` descends
...
...
Doc/library/functions.rst
Dosyayı görüntüle @
e65fcde8
...
@@ -331,7 +331,7 @@ are always available. They are listed here in alphabetical order.
...
@@ -331,7 +331,7 @@ are always available. They are listed here in alphabetical order.
The resulting list is sorted alphabetically. For example:
The resulting list is sorted alphabetically. For example:
>>> import struct
>>> import struct
>>> dir() # show the names in the module namespace
>>> dir() # show the names in the module namespace
# doctest: +SKIP
['__builtins__', '__name__', 'struct']
['__builtins__', '__name__', 'struct']
>>> dir(struct) # show the names in the struct module # doctest: +SKIP
>>> dir(struct) # show the names in the struct module # doctest: +SKIP
['Struct', '__all__', '__builtins__', '__cached__', '__doc__', '__file__',
['Struct', '__all__', '__builtins__', '__cached__', '__doc__', '__file__',
...
...
Doc/library/ipaddress.rst
Dosyayı görüntüle @
e65fcde8
...
@@ -25,9 +25,11 @@ This is the full module API reference—for an overview and introduction, see
...
@@ -25,9 +25,11 @@ This is the full module API reference—for an overview and introduction, see
.. versionadded:: 3.3
.. versionadded:: 3.3
.. testsetup::
.. testsetup::
>>> import ipaddress
>>> from ipaddress import (ip_network, IPv4Address, IPv4Interface,
import ipaddress
... IPv4Network)
from ipaddress import (
ip_network, IPv4Address, IPv4Interface, IPv4Network,
)
Convenience factory functions
Convenience factory functions
-----------------------------
-----------------------------
...
...
Doc/library/reprlib.rst
Dosyayı görüntüle @
e65fcde8
...
@@ -48,6 +48,7 @@ string instead.
...
@@ -48,6 +48,7 @@ string instead.
same thread. If a recursive call is made, the *fillvalue* is returned,
same thread. If a recursive call is made, the *fillvalue* is returned,
otherwise, the usual :meth:`__repr__` call is made. For example:
otherwise, the usual :meth:`__repr__` call is made. For example:
>>> from reprlib import recursive_repr
>>> class MyList(list):
>>> class MyList(list):
... @recursive_repr()
... @recursive_repr()
... def __repr__(self):
... def __repr__(self):
...
...
Doc/library/shlex.rst
Dosyayı görüntüle @
e65fcde8
...
@@ -43,15 +43,16 @@ The :mod:`shlex` module defines the following functions:
...
@@ -43,15 +43,16 @@ The :mod:`shlex` module defines the following functions:
string that can safely be used as one token in a shell command line, for
string that can safely be used as one token in a shell command line, for
cases where you cannot use a list.
cases where you cannot use a list.
This idiom would be unsafe:
:
This idiom would be unsafe:
>>> filename = 'somefile; rm -rf ~'
>>> filename = 'somefile; rm -rf ~'
>>> command = 'ls -l {}'.format(filename)
>>> command = 'ls -l {}'.format(filename)
>>> print(command) # executed by a shell: boom!
>>> print(command) # executed by a shell: boom!
ls -l somefile; rm -rf ~
ls -l somefile; rm -rf ~
:func:`quote` lets you plug the security hole:
:
:func:`quote` lets you plug the security hole:
>>> from shlex import quote
>>> command = 'ls -l {}'.format(quote(filename))
>>> command = 'ls -l {}'.format(quote(filename))
>>> print(command)
>>> print(command)
ls -l 'somefile; rm -rf ~'
ls -l 'somefile; rm -rf ~'
...
@@ -61,6 +62,7 @@ The :mod:`shlex` module defines the following functions:
...
@@ -61,6 +62,7 @@ The :mod:`shlex` module defines the following functions:
The quoting is compatible with UNIX shells and with :func:`split`:
The quoting is compatible with UNIX shells and with :func:`split`:
>>> from shlex import split
>>> remote_command = split(remote_command)
>>> remote_command = split(remote_command)
>>> remote_command
>>> remote_command
['ssh', 'home', "ls -l 'somefile; rm -rf ~'"]
['ssh', 'home', "ls -l 'somefile; rm -rf ~'"]
...
...
Doc/library/urllib.parse.rst
Dosyayı görüntüle @
e65fcde8
...
@@ -64,6 +64,9 @@ or on combining URL components into a URL string.
...
@@ -64,6 +64,9 @@ or on combining URL components into a URL string.
input is presumed to be a relative URL and thus to start with
input is presumed to be a relative URL and thus to start with
a path component.
a path component.
.. doctest::
:options: +NORMALIZE_WHITESPACE
>>> from urllib.parse import urlparse
>>> from urllib.parse import urlparse
>>> urlparse('//www.cwi.nl:80/%7Eguido/Python.html')
>>> urlparse('//www.cwi.nl:80/%7Eguido/Python.html')
ParseResult(scheme='', netloc='www.cwi.nl:80', path='/%7Eguido/Python.html',
ParseResult(scheme='', netloc='www.cwi.nl:80', path='/%7Eguido/Python.html',
...
...
Doc/whatsnew/3.2.rst
Dosyayı görüntüle @
e65fcde8
...
@@ -1062,13 +1062,16 @@ The :func:`~math.erf` function computes a probability integral or `Gaussian
...
@@ -1062,13 +1062,16 @@ The :func:`~math.erf` function computes a probability integral or `Gaussian
error function <https://en.wikipedia.org/wiki/Error_function>`_. The
error function <https://en.wikipedia.org/wiki/Error_function>`_. The
complementary error function, :func:`~math.erfc`, is ``1 - erf(x)``:
complementary error function, :func:`~math.erfc`, is ``1 - erf(x)``:
>>> from math import erf, erfc, sqrt
.. doctest::
>>> erf(1.0/sqrt(2.0)) # portion of normal distribution within 1 standard deviation
:options: +SKIP
0.682689492137086
>>> erfc(1.0/sqrt(2.0)) # portion of normal distribution outside 1 standard deviation
>>> from math import erf, erfc, sqrt
0.31731050786291404
>>> erf(1.0/sqrt(2.0)) # portion of normal distribution within 1 standard deviation
>>> erf(1.0/sqrt(2.0)) + erfc(1.0/sqrt(2.0))
0.682689492137086
1.0
>>> erfc(1.0/sqrt(2.0)) # portion of normal distribution outside 1 standard deviation
0.31731050786291404
>>> erf(1.0/sqrt(2.0)) + erfc(1.0/sqrt(2.0))
1.0
The :func:`~math.gamma` function is a continuous extension of the factorial
The :func:`~math.gamma` function is a continuous extension of the factorial
function. See https://en.wikipedia.org/wiki/Gamma_function for details. Because
function. See https://en.wikipedia.org/wiki/Gamma_function for details. Because
...
@@ -1384,7 +1387,7 @@ guaranteed not to block when :func:`select.select` says a pipe is ready
...
@@ -1384,7 +1387,7 @@ guaranteed not to block when :func:`select.select` says a pipe is ready
for writing.
for writing.
>>> import select
>>> import select
>>> select.PIPE_BUF
>>> select.PIPE_BUF
# doctest: +SKIP
512
512
(Available on Unix systems. Patch by Sébastien Sablé in :issue:`9862`)
(Available on Unix systems. Patch by Sébastien Sablé in :issue:`9862`)
...
...
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