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
b2a7c2f9
Kaydet (Commit)
b2a7c2f9
authored
Mar 02, 2017
tarafından
Marco Buttu
Kaydeden (comit)
Berker Peksag
Mar 02, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-27200: fix configparser, copyreg and ctypes doctests (#240)
üst
6a9122ce
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
15 deletions
+22
-15
configparser.rst
Doc/library/configparser.rst
+17
-12
copyreg.rst
Doc/library/copyreg.rst
+2
-2
ctypes.rst
Doc/library/ctypes.rst
+3
-1
No files found.
Doc/library/configparser.rst
Dosyayı görüntüle @
b2a7c2f9
...
...
@@ -42,6 +42,11 @@ can be customized by end users easily.
be used for this purpose.
.. testsetup::
import configparser
Quick Start
-----------
...
...
@@ -95,7 +100,6 @@ back and explore the data it holds.
.. doctest::
>>> import configparser
>>> config = configparser.ConfigParser()
>>> config.sections()
[]
...
...
@@ -116,8 +120,8 @@ back and explore the data it holds.
'no'
>>> topsecret['Port']
'50022'
>>> for key in config['bitbucket.org']:
print(key)
...
>>> for key in config['bitbucket.org']:
# doctest: +SKIP
...
print(key)
user
compressionlevel
serveraliveinterval
...
...
@@ -469,9 +473,9 @@ the :meth:`__init__` options:
... 'bar': 'y',
... 'baz': 'z'}
... })
>>> parser.sections()
>>> parser.sections()
# doctest: +SKIP
['section3', 'section2', 'section1']
>>> [option for option in parser['section3']]
>>> [option for option in parser['section3']]
# doctest: +SKIP
['baz', 'foo', 'bar']
In these operations you need to use an ordered dictionary as well:
...
...
@@ -498,11 +502,11 @@ the :meth:`__init__` options:
... ),
... ))
... )
>>> parser.sections()
>>> parser.sections()
# doctest: +SKIP
['s1', 's2']
>>> [option for option in parser['s1']]
>>> [option for option in parser['s1']]
# doctest: +SKIP
['1', '3', '5']
>>> [option for option in parser['s2'].values()]
>>> [option for option in parser['s2'].values()]
# doctest: +SKIP
['b', 'd', 'f']
* *allow_no_value*, default value: ``False``
...
...
@@ -597,11 +601,11 @@ the :meth:`__init__` options:
... line #3
... """)
>>> print(parser['hashes']['shebang'])
<BLANKLINE>
#!/usr/bin/env python
# -*- coding: utf-8 -*-
>>> print(parser['hashes']['extensions'])
<BLANKLINE>
enabled_extension
another_extension
yet_another_extension
...
...
@@ -755,6 +759,7 @@ be overridden by subclasses or by attribute assignment.
.. doctest::
>>> import re
>>> config = """
... [Section 1]
... option = value
...
...
@@ -762,11 +767,11 @@ be overridden by subclasses or by attribute assignment.
... [ Section 2 ]
... another = val
... """
>>> typical = ConfigParser()
>>> typical =
configparser.
ConfigParser()
>>> typical.read_string(config)
>>> typical.sections()
['Section 1', ' Section 2 ']
>>> custom = ConfigParser()
>>> custom =
configparser.
ConfigParser()
>>> custom.SECTCRE = re.compile(r"\[ *(?P<header>[^]]+?) *\]")
>>> custom.read_string(config)
>>> custom.sections()
...
...
Doc/library/copyreg.rst
Dosyayı görüntüle @
b2a7c2f9
...
...
@@ -59,7 +59,7 @@ it will be used:
...
>>> copyreg.pickle(C, pickle_c)
>>> c = C(1)
>>> d = copy.copy(c)
>>> d = copy.copy(c)
# doctest: +SKIP
pickling a C instance...
>>> p = pickle.dumps(c)
>>> p = pickle.dumps(c)
# doctest: +SKIP
pickling a C instance...
Doc/library/ctypes.rst
Dosyayı görüntüle @
b2a7c2f9
...
...
@@ -1406,8 +1406,10 @@ Instances of these classes have no public methods. Functions exported by the
shared library can be accessed as attributes or by index. Please note that
accessing the function through an attribute caches the result and therefore
accessing it repeatedly returns the same object each time. On the other hand,
accessing it through an index returns a new object each time:
accessing it through an index returns a new object each time:
:
>>> from ctypes import CDLL
>>> libc = CDLL("libc.so.6") # On Linux
>>> libc.time == libc.time
True
>>> libc['time'] == libc['time']
...
...
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