Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
A
astor
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
astor
Commits
fe1ef7f9
Unverified
Kaydet (Commit)
fe1ef7f9
authored
Mar 23, 2018
tarafından
Berker Peksag
Kaydeden (comit)
GitHub
Mar 23, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Don't use 'async' as a keyword argument (#94)
Fixes #86
üst
7b0fa748
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
9 deletions
+32
-9
.travis.yml
.travis.yml
+2
-0
code_gen.py
astor/code_gen.py
+9
-9
changelog.rst
docs/changelog.rst
+21
-0
No files found.
.travis.yml
Dosyayı görüntüle @
fe1ef7f9
...
...
@@ -9,9 +9,11 @@ python:
-
3.6
-
pypy
-
pypy3.3-5.2-alpha1
-
3.7-dev
matrix
:
allow_failures
:
-
python
:
2.6
-
python
:
3.7-dev
cache
:
pip
install
:
-
pip install tox-travis
...
...
astor/code_gen.py
Dosyayı görüntüle @
fe1ef7f9
...
...
@@ -308,8 +308,8 @@ class SourceGenerator(ExplicitNodeVisitor):
self
.
statement
(
node
)
self
.
generic_visit
(
node
)
def
visit_FunctionDef
(
self
,
node
,
async
=
False
):
prefix
=
'async '
if
async
else
''
def
visit_FunctionDef
(
self
,
node
,
is_
async
=
False
):
prefix
=
'async '
if
is_
async
else
''
self
.
decorators
(
node
,
1
if
self
.
indentation
else
2
)
self
.
statement
(
node
,
'
%
sdef
%
s'
%
(
prefix
,
node
.
name
),
'('
)
self
.
visit_arguments
(
node
.
args
)
...
...
@@ -322,7 +322,7 @@ class SourceGenerator(ExplicitNodeVisitor):
# introduced in Python 3.5
def
visit_AsyncFunctionDef
(
self
,
node
):
self
.
visit_FunctionDef
(
node
,
async
=
True
)
self
.
visit_FunctionDef
(
node
,
is_
async
=
True
)
def
visit_ClassDef
(
self
,
node
):
have_args
=
[]
...
...
@@ -364,24 +364,24 @@ class SourceGenerator(ExplicitNodeVisitor):
self
.
else_body
(
else_
)
break
def
visit_For
(
self
,
node
,
async
=
False
):
def
visit_For
(
self
,
node
,
is_
async
=
False
):
set_precedence
(
node
,
node
.
target
)
prefix
=
'async '
if
async
else
''
prefix
=
'async '
if
is_
async
else
''
self
.
statement
(
node
,
'
%
sfor '
%
prefix
,
node
.
target
,
' in '
,
node
.
iter
,
':'
)
self
.
body_or_else
(
node
)
# introduced in Python 3.5
def
visit_AsyncFor
(
self
,
node
):
self
.
visit_For
(
node
,
async
=
True
)
self
.
visit_For
(
node
,
is_
async
=
True
)
def
visit_While
(
self
,
node
):
set_precedence
(
node
,
node
.
test
)
self
.
statement
(
node
,
'while '
,
node
.
test
,
':'
)
self
.
body_or_else
(
node
)
def
visit_With
(
self
,
node
,
async
=
False
):
prefix
=
'async '
if
async
else
''
def
visit_With
(
self
,
node
,
is_
async
=
False
):
prefix
=
'async '
if
is_
async
else
''
self
.
statement
(
node
,
'
%
swith '
%
prefix
)
if
hasattr
(
node
,
"context_expr"
):
# Python < 3.3
self
.
visit_withitem
(
node
)
...
...
@@ -392,7 +392,7 @@ class SourceGenerator(ExplicitNodeVisitor):
# new for Python 3.5
def
visit_AsyncWith
(
self
,
node
):
self
.
visit_With
(
node
,
async
=
True
)
self
.
visit_With
(
node
,
is_
async
=
True
)
# new for Python 3.3
def
visit_withitem
(
self
,
node
):
...
...
docs/changelog.rst
Dosyayı görüntüle @
fe1ef7f9
...
...
@@ -2,6 +2,27 @@
Release Notes
=============
0.7.0 - 2018-03-24
------------------
New features
~~~~~~~~~~~~
* Added initial support for Python 3.7.0.
Note that if you have a subclass of ``astor.code_gen.SourceGenerator``, you
may need to rename the keyword argument ``async`` of the following methods
to ``is_async``:
- ``visit_FunctionDef(..., is_async=False)``
- ``visit_For(..., is_async=False)``
- ``visit_With(..., is_async=False)``
(Reported and fixed by Berker Peksag in `Issue 86`_.)
.. _`Issue 86`: https://github.com/berkerpeksag/astor/issues/86
0.6.2 - 2017-11-11
------------------
...
...
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