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
75b64e65
Kaydet (Commit)
75b64e65
authored
Ock 16, 2005
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use decorators.
üst
9ba3684e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
15 deletions
+8
-15
Eiffel.py
Demo/newmetaclasses/Eiffel.py
+2
-4
UserDict.py
Lib/UserDict.py
+1
-1
tarfile.py
Lib/tarfile.py
+5
-10
No files found.
Demo/newmetaclasses/Eiffel.py
Dosyayı görüntüle @
75b64e65
...
...
@@ -9,6 +9,7 @@ class EiffelBaseMetaClass(type):
return
super
(
EiffelBaseMetaClass
,
meta
)
.
__new__
(
meta
,
name
,
bases
,
dict
)
@classmethod
def
convert_methods
(
cls
,
dict
):
"""Replace functions in dict with EiffelMethod wrappers.
...
...
@@ -30,11 +31,10 @@ class EiffelBaseMetaClass(type):
if
pre
or
post
:
dict
[
k
]
=
cls
.
make_eiffel_method
(
dict
[
m
],
pre
,
post
)
convert_methods
=
classmethod
(
convert_methods
)
class
EiffelMetaClass1
(
EiffelBaseMetaClass
):
# an implementation of the "eiffel" meta class that uses nested functions
@staticmethod
def
make_eiffel_method
(
func
,
pre
,
post
):
def
method
(
self
,
*
args
,
**
kwargs
):
if
pre
:
...
...
@@ -49,8 +49,6 @@ class EiffelMetaClass1(EiffelBaseMetaClass):
return
method
make_eiffel_method
=
staticmethod
(
make_eiffel_method
)
class
EiffelMethodWrapper
:
def
__init__
(
self
,
inst
,
descr
):
...
...
Lib/UserDict.py
Dosyayı görüntüle @
75b64e65
...
...
@@ -63,12 +63,12 @@ class UserDict:
return
self
.
data
.
popitem
()
def
__contains__
(
self
,
key
):
return
key
in
self
.
data
@classmethod
def
fromkeys
(
cls
,
iterable
,
value
=
None
):
d
=
cls
()
for
key
in
iterable
:
d
[
key
]
=
value
return
d
fromkeys
=
classmethod
(
fromkeys
)
class
IterableUserDict
(
UserDict
):
def
__iter__
(
self
):
...
...
Lib/tarfile.py
Dosyayı görüntüle @
75b64e65
...
...
@@ -656,6 +656,7 @@ class TarInfo(object):
def
__repr__
(
self
):
return
"<
%
s
%
r at
%#
x>"
%
(
self
.
__class__
.
__name__
,
self
.
name
,
id
(
self
))
@classmethod
def
frombuf
(
cls
,
buf
):
"""Construct a TarInfo object from a 512 byte string buffer.
"""
...
...
@@ -699,8 +700,6 @@ class TarInfo(object):
tarinfo
.
name
+=
"/"
return
tarinfo
frombuf
=
classmethod
(
frombuf
)
def
tobuf
(
self
):
"""Return a tar header block as a 512 byte string.
"""
...
...
@@ -858,6 +857,7 @@ class TarFile(object):
# the super-constructor. A sub-constructor is registered and made available
# by adding it to the mapping in OPEN_METH.
@classmethod
def
open
(
cls
,
name
=
None
,
mode
=
"r"
,
fileobj
=
None
,
bufsize
=
20
*
512
):
"""Open a tar archive for reading, writing or appending. Return
an appropriate TarFile class.
...
...
@@ -923,8 +923,7 @@ class TarFile(object):
raise
ValueError
,
"undiscernible mode"
open
=
classmethod
(
open
)
@classmethod
def
taropen
(
cls
,
name
,
mode
=
"r"
,
fileobj
=
None
):
"""Open uncompressed tar archive name for reading or writing.
"""
...
...
@@ -932,8 +931,7 @@ class TarFile(object):
raise
ValueError
,
"mode must be 'r', 'a' or 'w'"
return
cls
(
name
,
mode
,
fileobj
)
taropen
=
classmethod
(
taropen
)
@classmethod
def
gzopen
(
cls
,
name
,
mode
=
"r"
,
fileobj
=
None
,
compresslevel
=
9
):
"""Open gzip compressed tar archive name for reading or writing.
Appending is not allowed.
...
...
@@ -970,8 +968,7 @@ class TarFile(object):
t
.
_extfileobj
=
False
return
t
gzopen
=
classmethod
(
gzopen
)
@classmethod
def
bz2open
(
cls
,
name
,
mode
=
"r"
,
fileobj
=
None
,
compresslevel
=
9
):
"""Open bzip2 compressed tar archive name for reading or writing.
Appending is not allowed.
...
...
@@ -1002,8 +999,6 @@ class TarFile(object):
t
.
_extfileobj
=
False
return
t
bz2open
=
classmethod
(
bz2open
)
# All *open() methods are registered here.
OPEN_METH
=
{
"tar"
:
"taropen"
,
# uncompressed tar
...
...
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