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
09835dcd
Kaydet (Commit)
09835dcd
authored
Eyl 11, 2016
tarafından
Eric V. Smith
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make an f-string error message more exact and consistent.
üst
13a6d283
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
test_fstring.py
Lib/test/test_fstring.py
+2
-1
ast.c
Python/ast.c
+1
-1
No files found.
Lib/test/test_fstring.py
Dosyayı görüntüle @
09835dcd
...
...
@@ -182,9 +182,10 @@ f'{a * x()}'"""
self
.
assertEqual
(
f
'{"#"}'
,
'#'
)
self
.
assertEqual
(
f
'{d["#"]}'
,
'hash'
)
self
.
assertAllRaise
(
SyntaxError
,
"f-string cannot include '#'"
,
self
.
assertAllRaise
(
SyntaxError
,
"f-string
expression part
cannot include '#'"
,
[
"f'{1#}'"
,
# error because the expression becomes "(1#)"
"f'{3(#)}'"
,
"f'{#}'"
,
])
def
test_many_expressions
(
self
):
...
...
Python/ast.c
Dosyayı görüntüle @
09835dcd
...
...
@@ -4419,7 +4419,7 @@ fstring_find_expr(const char **str, const char *end, int raw, int recurse_lvl,
}
else
if
(
ch
==
'#'
)
{
/* Error: can't include a comment character, inside parens
or not. */
ast_error
(
c
,
n
,
"f-string cannot include '#'"
);
ast_error
(
c
,
n
,
"f-string
expression part
cannot include '#'"
);
return
-
1
;
}
else
if
(
nested_depth
==
0
&&
(
ch
==
'!'
||
ch
==
':'
||
ch
==
'}'
))
{
...
...
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