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
409d8f2e
Kaydet (Commit)
409d8f2e
authored
Mar 05, 2005
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Allow classes to be defined with empty parentheses. This means that
``class C(): pass`` is no longer a syntax error.
üst
653a5adc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
9 deletions
+14
-9
Grammar
Grammar/Grammar
+1
-1
NEWS
Misc/NEWS
+3
-0
compile.c
Python/compile.c
+3
-2
graminit.c
Python/graminit.c
+7
-6
No files found.
Grammar/Grammar
Dosyayı görüntüle @
409d8f2e
...
...
@@ -99,7 +99,7 @@ testlist: test (',' test)* [',']
testlist_safe: test [(',' test)+ [',']]
dictmaker: test ':' test (',' test ':' test)* [',']
classdef: 'class' NAME ['('
testlist
')'] ':' suite
classdef: 'class' NAME ['('
[testlist]
')'] ':' suite
arglist: (argument ',')* (argument [',']| '*' test [',' '**' test] | '**' test)
argument: [test '='] test [gen_for] # Really [keyword '='] test
...
...
Misc/NEWS
Dosyayı görüntüle @
409d8f2e
...
...
@@ -10,6 +10,9 @@ What's New in Python 2.5 alpha 1?
Core and builtins
-----------------
- Defining a class with empty parentheses is now allowed
(e.g., ``class C(): pass`` is no longer a syntax error)
- Patch #1115086: Support PY_LONGLONG in structmember.
- Bug #1155938: new style classes did not check that __init__() was
...
...
Python/compile.c
Dosyayı görüntüle @
409d8f2e
...
...
@@ -4624,7 +4624,7 @@ com_classdef(struct compiling *c, node *n)
char
*
name
;
REQ
(
n
,
classdef
);
/* classdef: class NAME ['('
testlist
')'] ':' suite */
/* classdef: class NAME ['('
[testlist]
')'] ':' suite */
if
((
v
=
PyString_InternFromString
(
STR
(
CHILD
(
n
,
1
))))
==
NULL
)
{
c
->
c_errors
++
;
return
;
...
...
@@ -4635,7 +4635,8 @@ com_classdef(struct compiling *c, node *n)
com_push
(
c
,
1
);
Py_DECREF
(
v
);
/* Push the tuple of base classes on the stack */
if
(
TYPE
(
CHILD
(
n
,
2
))
!=
LPAR
)
{
if
(
TYPE
(
CHILD
(
n
,
2
))
!=
LPAR
||
TYPE
(
CHILD
(
n
,
3
))
==
RPAR
)
{
com_addoparg
(
c
,
BUILD_TUPLE
,
0
);
com_push
(
c
,
1
);
}
...
...
Python/graminit.c
Dosyayı görüntüle @
409d8f2e
...
...
@@ -1426,26 +1426,27 @@ static arc arcs_67_2[2] = {
{
13
,
3
},
{
21
,
4
},
};
static
arc
arcs_67_3
[
1
]
=
{
static
arc
arcs_67_3
[
2
]
=
{
{
9
,
5
},
{
15
,
6
},
};
static
arc
arcs_67_4
[
1
]
=
{
{
22
,
6
},
{
22
,
7
},
};
static
arc
arcs_67_5
[
1
]
=
{
{
15
,
7
},
{
15
,
6
},
};
static
arc
arcs_67_6
[
1
]
=
{
{
0
,
6
},
{
21
,
4
},
};
static
arc
arcs_67_7
[
1
]
=
{
{
21
,
4
},
{
0
,
7
},
};
static
state
states_67
[
8
]
=
{
{
1
,
arcs_67_0
},
{
1
,
arcs_67_1
},
{
2
,
arcs_67_2
},
{
1
,
arcs_67_3
},
{
2
,
arcs_67_3
},
{
1
,
arcs_67_4
},
{
1
,
arcs_67_5
},
{
1
,
arcs_67_6
},
...
...
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