Skip to content

Commit d038f10

Browse files
author
georg.brandl
committed
Patch #1552024: add decorator support to unparse.py demo script.
git-svn-id: http://svn.python.org/projects/python/trunk@52488 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent d330682 commit d038f10

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

Demo/parser/unparse.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ def _ClassDef(self, t):
223223

224224
def _FunctionDef(self, t):
225225
self.write("\n")
226+
for deco in t.decorators:
227+
self.fill("@")
228+
self.dispatch(deco)
226229
self.fill("def "+t.name + "(")
227230
self.dispatch(t.args)
228231
self.write(")")

Misc/NEWS

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ Library
156156
- fixed a bug with bsddb.DB.stat: the flags and txn keyword arguments
157157
were transposed.
158158

159+
159160
Extension Modules
160161
-----------------
161162

@@ -225,8 +226,10 @@ Documentation
225226
to a newly created list object and add notes that this isn't a good idea.
226227

227228

228-
Tools
229-
-----
229+
Tools/Demos
230+
-----------
231+
232+
- Patch #1552024: add decorator support to unparse.py demo script.
230233

231234
- Make auto-generated python.vim file list built-ins and exceptions in
232235
alphatbetical order. Makes output more deterministic and easier to tell if

0 commit comments

Comments
 (0)