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
89675078
Kaydet (Commit)
89675078
authored
Agu 24, 2001
tarafından
Tim Peters
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Back out trying to use the C values for CO_xxx.
__future__.py reverted to 1.9. newmodule.c reverted to 2.32.
üst
4e2fbce7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
41 deletions
+12
-41
__future__.py
Lib/__future__.py
+10
-10
newmodule.c
Modules/newmodule.c
+2
-31
No files found.
Lib/__future__.py
Dosyayı görüntüle @
89675078
...
...
@@ -55,13 +55,13 @@ all_feature_names = [
__all__
=
[
"all_feature_names"
]
+
all_feature_names
try
:
import
new
as
_new
# for CO_xxx symbols
except
ImportError
:
# May happen during build
class
_new
:
CO_NESTED
=
0x0010
CO_GENERATOR_ALLOWED
=
0x1000
CO_FUTURE_DIVISION
=
0x2000
# The CO_xxx symbols are defined here under the same names used by
# compile.h, so that an editor search will find them here. However,
# they're not exported in __all__, because they don't really belong to
# this module.
CO_NESTED
=
0x0010
# nested_scopes
CO_GENERATOR_ALLOWED
=
0x1000
# generators
CO_FUTURE_DIVISION
=
0x2000
# division
class
_Feature
:
def
__init__
(
self
,
optionalRelease
,
mandatoryRelease
,
compiler_flag
):
...
...
@@ -92,12 +92,12 @@ class _Feature:
nested_scopes
=
_Feature
((
2
,
1
,
0
,
"beta"
,
1
),
(
2
,
2
,
0
,
"alpha"
,
0
),
_new
.
CO_NESTED
)
CO_NESTED
)
generators
=
_Feature
((
2
,
2
,
0
,
"alpha"
,
1
),
(
2
,
3
,
0
,
"final"
,
0
),
_new
.
CO_GENERATOR_ALLOWED
)
CO_GENERATOR_ALLOWED
)
division
=
_Feature
((
2
,
2
,
0
,
"alpha"
,
2
),
(
3
,
0
,
0
,
"alpha"
,
0
),
_new
.
CO_FUTURE_DIVISION
)
CO_FUTURE_DIVISION
)
Modules/newmodule.c
Dosyayı görüntüle @
89675078
...
...
@@ -220,38 +220,9 @@ char new_doc[] =
\n
\
You need to know a great deal about the interpreter to use this!"
;
static
void
insertint
(
PyObject
*
d
,
char
*
name
,
int
value
)
{
PyObject
*
v
=
PyInt_FromLong
((
long
)
value
);
if
(
v
==
NULL
)
{
/* Don't bother reporting this error */
PyErr_Clear
();
}
else
{
PyDict_SetItemString
(
d
,
name
,
v
);
Py_DECREF
(
v
);
}
}
DL_EXPORT
(
void
)
initnew
(
void
)
{
PyObject
*
m
;
PyObject
*
d
;
m
=
Py_InitModule4
(
"new"
,
new_methods
,
new_doc
,
(
PyObject
*
)
NULL
,
PYTHON_API_VERSION
);
d
=
PyModule_GetDict
(
m
);
#define ADDSYM(TOKEN) insertint(d, #TOKEN, TOKEN)
ADDSYM
(
CO_OPTIMIZED
);
ADDSYM
(
CO_NEWLOCALS
);
ADDSYM
(
CO_VARARGS
);
ADDSYM
(
CO_VARKEYWORDS
);
ADDSYM
(
CO_NESTED
);
ADDSYM
(
CO_GENERATOR
);
ADDSYM
(
CO_GENERATOR_ALLOWED
);
ADDSYM
(
CO_FUTURE_DIVISION
);
#undef ADDSYM
Py_InitModule4
(
"new"
,
new_methods
,
new_doc
,
(
PyObject
*
)
NULL
,
PYTHON_API_VERSION
);
}
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