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
d6dcf826
Kaydet (Commit)
d6dcf826
authored
May 01, 2011
tarafından
Éric Araujo
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add docstring to anydbm.open
üst
015014ff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
anydbm.py
Lib/anydbm.py
+13
-11
No files found.
Lib/anydbm.py
Dosyayı görüntüle @
d6dcf826
...
@@ -29,17 +29,8 @@ It has the following interface (key and data are strings):
...
@@ -29,17 +29,8 @@ It has the following interface (key and data are strings):
list = d.keys() # return a list of all existing keys (slow!)
list = d.keys() # return a list of all existing keys (slow!)
Future versions may change the order in which implementations are
Future versions may change the order in which implementations are
tested for existence, add interfaces to other dbm-like
tested for existence, a
nd a
dd interfaces to other dbm-like
implementations.
implementations.
The open function has an optional second argument. This can be 'r',
for read-only access, 'w', for read-write access of an existing
database, 'c' for read-write access to a new or existing database, and
'n' for read-write access to a new database. The default is 'r'.
Note: 'r' and 'w' fail if the database doesn't exist; 'c' creates it
only if it doesn't exist; and 'n' always creates a new database.
"""
"""
class
error
(
Exception
):
class
error
(
Exception
):
...
@@ -63,7 +54,18 @@ if not _defaultmod:
...
@@ -63,7 +54,18 @@ if not _defaultmod:
error
=
tuple
(
_errors
)
error
=
tuple
(
_errors
)
def
open
(
file
,
flag
=
'r'
,
mode
=
0666
):
def
open
(
file
,
flag
=
'r'
,
mode
=
0666
):
"""Open or create database at path given by *file*.
Optional argument *flag* can be 'r' (default) for read-only access, 'w'
for read-write access of an existing database, 'c' for read-write access
to a new or existing database, and 'n' for read-write access to a new
database.
Note: 'r' and 'w' fail if the database doesn't exist; 'c' creates it
only if it doesn't exist; and 'n' always creates a new database.
"""
# guess the type of an existing database
# guess the type of an existing database
from
whichdb
import
whichdb
from
whichdb
import
whichdb
result
=
whichdb
(
file
)
result
=
whichdb
(
file
)
...
...
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