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
67b212e6
Kaydet (Commit)
67b212e6
authored
Ock 08, 2011
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #10859: Make `contextlib.GeneratorContextManager` officially
private by renaming it to `_GeneratorContextManager`.
üst
d97b7b51
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
8 deletions
+11
-8
contextlib.py
Lib/contextlib.py
+2
-2
test_with.py
Lib/test/test_with.py
+6
-6
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/contextlib.py
Dosyayı görüntüle @
67b212e6
...
...
@@ -17,7 +17,7 @@ class ContextDecorator(object):
return
inner
class
GeneratorContextManager
(
ContextDecorator
):
class
_
GeneratorContextManager
(
ContextDecorator
):
"""Helper for @contextmanager decorator."""
def
__init__
(
self
,
gen
):
...
...
@@ -92,7 +92,7 @@ def contextmanager(func):
"""
@wraps
(
func
)
def
helper
(
*
args
,
**
kwds
):
return
GeneratorContextManager
(
func
(
*
args
,
**
kwds
))
return
_
GeneratorContextManager
(
func
(
*
args
,
**
kwds
))
return
helper
...
...
Lib/test/test_with.py
Dosyayı görüntüle @
67b212e6
...
...
@@ -9,26 +9,26 @@ __email__ = "mbland at acm dot org"
import
sys
import
unittest
from
collections
import
deque
from
contextlib
import
GeneratorContextManager
,
contextmanager
from
contextlib
import
_
GeneratorContextManager
,
contextmanager
from
test.support
import
run_unittest
class
MockContextManager
(
GeneratorContextManager
):
class
MockContextManager
(
_
GeneratorContextManager
):
def
__init__
(
self
,
gen
):
GeneratorContextManager
.
__init__
(
self
,
gen
)
_
GeneratorContextManager
.
__init__
(
self
,
gen
)
self
.
enter_called
=
False
self
.
exit_called
=
False
self
.
exit_args
=
None
def
__enter__
(
self
):
self
.
enter_called
=
True
return
GeneratorContextManager
.
__enter__
(
self
)
return
_
GeneratorContextManager
.
__enter__
(
self
)
def
__exit__
(
self
,
type
,
value
,
traceback
):
self
.
exit_called
=
True
self
.
exit_args
=
(
type
,
value
,
traceback
)
return
GeneratorContextManager
.
__exit__
(
self
,
type
,
value
,
traceback
)
return
_
GeneratorContextManager
.
__exit__
(
self
,
type
,
value
,
traceback
)
def
mock_contextmanager
(
func
):
...
...
Misc/NEWS
Dosyayı görüntüle @
67b212e6
...
...
@@ -40,6 +40,9 @@ Core and Builtins
Library
-------
- Issue #10859: Make ``contextlib.GeneratorContextManager`` officially
private by renaming it to ``_GeneratorContextManager``.
- Issue #10042: Fixed the total_ordering decorator to handle cross-type
comparisons that could lead to infinite recursion.
...
...
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