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
a8f6f1e2
Kaydet (Commit)
a8f6f1e2
authored
Ara 20, 2009
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed capitalization and markup; added imports in the example
üst
7e5229c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
tokenize.rst
Doc/library/tokenize.rst
+6
-3
No files found.
Doc/library/tokenize.rst
Dosyayı görüntüle @
a8f6f1e2
...
...
@@ -94,16 +94,19 @@ function it uses to do this is available:
(as a string) and a list of any lines (not decoded from bytes) it has read
in.
It detects the encoding from the presence of a
utf-8 bom
or an encoding
cookie as specified in
pep-0263. If both a bom
and a cookie are present,
It detects the encoding from the presence of a
UTF-8 BOM
or an encoding
cookie as specified in
:pep:`263`. If both a BOM
and a cookie are present,
but disagree, a SyntaxError will be raised.
If no encoding is specified, then the default of
'utf-8'
will be returned.
If no encoding is specified, then the default of
``'utf-8'``
will be returned.
Example of a script re-writer that transforms float literals into Decimal
objects::
from tokenize import tokenize, untokenize, NUMBER, STRING, NAME, OP
from io import BytesIO
def decistmt(s):
"""Substitute Decimals for floats in a string of statements.
...
...
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