Commit ff41c48a authored by Raymond Hettinger's avatar Raymond Hettinger

SF patch #701494: more apply removals

parent 50c61d5a
...@@ -72,7 +72,7 @@ def Node(*args): ...@@ -72,7 +72,7 @@ def Node(*args):
kind = args[0] kind = args[0]
if nodes.has_key(kind): if nodes.has_key(kind):
try: try:
return apply(nodes[kind], args[1:]) return nodes[kind](*args[1:])
except TypeError: except TypeError:
print nodes[kind], len(args), args print nodes[kind], len(args), args
raise raise
......
...@@ -41,7 +41,7 @@ def wrapper(func, *rest): ...@@ -41,7 +41,7 @@ def wrapper(func, *rest):
except: except:
pass pass
res = apply(func, (stdscr,) + rest) res = func(stdscr, *rest)
except: except:
# In the event of an error, restore the terminal # In the event of an error, restore the terminal
# to a sane state. # to a sane state.
......
...@@ -55,7 +55,7 @@ class CanvasItem: ...@@ -55,7 +55,7 @@ class CanvasItem:
def coords(self, pts = ()): def coords(self, pts = ()):
flat = () flat = ()
for x, y in pts: flat = flat + (x, y) for x, y in pts: flat = flat + (x, y)
return apply(self.canvas.coords, (self.id,) + flat) return self.canvas.coords(self.id, *flat)
def dchars(self, first, last=None): def dchars(self, first, last=None):
self.canvas.dchars(self.id, first, last) self.canvas.dchars(self.id, first, last)
def dtag(self, ttd): def dtag(self, ttd):
...@@ -84,40 +84,40 @@ class CanvasItem: ...@@ -84,40 +84,40 @@ class CanvasItem:
class Arc(CanvasItem): class Arc(CanvasItem):
def __init__(self, canvas, *args, **kw): def __init__(self, canvas, *args, **kw):
apply(CanvasItem.__init__, (self, canvas, 'arc') + args, kw) CanvasItem.__init__(self, canvas, 'arc', *args, **kw)
class Bitmap(CanvasItem): class Bitmap(CanvasItem):
def __init__(self, canvas, *args, **kw): def __init__(self, canvas, *args, **kw):
apply(CanvasItem.__init__, (self, canvas, 'bitmap') + args, kw) CanvasItem.__init__(self, canvas, 'bitmap', *args, **kw)
class ImageItem(CanvasItem): class ImageItem(CanvasItem):
def __init__(self, canvas, *args, **kw): def __init__(self, canvas, *args, **kw):
apply(CanvasItem.__init__, (self, canvas, 'image') + args, kw) CanvasItem.__init__(self, canvas, 'image', *args, **kw)
class Line(CanvasItem): class Line(CanvasItem):
def __init__(self, canvas, *args, **kw): def __init__(self, canvas, *args, **kw):
apply(CanvasItem.__init__, (self, canvas, 'line') + args, kw) CanvasItem.__init__(self, canvas, 'line', *args, **kw)
class Oval(CanvasItem): class Oval(CanvasItem):
def __init__(self, canvas, *args, **kw): def __init__(self, canvas, *args, **kw):
apply(CanvasItem.__init__, (self, canvas, 'oval') + args, kw) CanvasItem.__init__(self, canvas, 'oval', *args, **kw)
class Polygon(CanvasItem): class Polygon(CanvasItem):
def __init__(self, canvas, *args, **kw): def __init__(self, canvas, *args, **kw):
apply(CanvasItem.__init__, (self, canvas, 'polygon') + args,kw) CanvasItem.__init__(self, canvas, 'polygon', *args, **kw)
class Rectangle(CanvasItem): class Rectangle(CanvasItem):
def __init__(self, canvas, *args, **kw): def __init__(self, canvas, *args, **kw):
apply(CanvasItem.__init__, (self, canvas, 'rectangle')+args,kw) CanvasItem.__init__(self, canvas, 'rectangle', *args, **kw)
# XXX "Text" is taken by the Text widget... # XXX "Text" is taken by the Text widget...
class CanvasText(CanvasItem): class CanvasText(CanvasItem):
def __init__(self, canvas, *args, **kw): def __init__(self, canvas, *args, **kw):
apply(CanvasItem.__init__, (self, canvas, 'text') + args, kw) CanvasItem.__init__(self, canvas, 'text', *args, **kw)
class Window(CanvasItem): class Window(CanvasItem):
def __init__(self, canvas, *args, **kw): def __init__(self, canvas, *args, **kw):
apply(CanvasItem.__init__, (self, canvas, 'window') + args, kw) CanvasItem.__init__(self, canvas, 'window', *args, **kw)
class Group: class Group:
def __init__(self, canvas, tag=None): def __init__(self, canvas, tag=None):
......
...@@ -15,11 +15,11 @@ class Dialog(Widget): ...@@ -15,11 +15,11 @@ class Dialog(Widget):
self.widgetName = '__dialog__' self.widgetName = '__dialog__'
Widget._setup(self, master, cnf) Widget._setup(self, master, cnf)
self.num = self.tk.getint( self.num = self.tk.getint(
apply(self.tk.call, self.tk.call(
('tk_dialog', self._w, 'tk_dialog', self._w,
cnf['title'], cnf['text'], cnf['title'], cnf['text'],
cnf['bitmap'], cnf['default']) cnf['bitmap'], cnf['default'],
+ cnf['strings'])) *cnf['strings']))
try: Widget.destroy(self) try: Widget.destroy(self)
except TclError: pass except TclError: pass
def destroy(self): pass def destroy(self): pass
......
...@@ -24,11 +24,11 @@ class ScrolledText(Text): ...@@ -24,11 +24,11 @@ class ScrolledText(Text):
if type(k) == ClassType or k == 'name': if type(k) == ClassType or k == 'name':
fcnf[k] = cnf[k] fcnf[k] = cnf[k]
del cnf[k] del cnf[k]
self.frame = apply(Frame, (master,), fcnf) self.frame = Frame(master, **fcnf)
self.vbar = Scrollbar(self.frame, name='vbar') self.vbar = Scrollbar(self.frame, name='vbar')
self.vbar.pack(side=RIGHT, fill=Y) self.vbar.pack(side=RIGHT, fill=Y)
cnf['name'] = 'text' cnf['name'] = 'text'
apply(Text.__init__, (self, self.frame), cnf) Text.__init__(self, self.frame, **cnf)
self.pack(side=LEFT, fill=BOTH, expand=1) self.pack(side=LEFT, fill=BOTH, expand=1)
self['yscrollcommand'] = self.vbar.set self['yscrollcommand'] = self.vbar.set
self.vbar['command'] = self.yview self.vbar['command'] = self.yview
......
This diff is collapsed.
...@@ -444,7 +444,7 @@ class Misc: ...@@ -444,7 +444,7 @@ class Misc:
tmp = [] tmp = []
def callit(func=func, args=args, self=self, tmp=tmp): def callit(func=func, args=args, self=self, tmp=tmp):
try: try:
apply(func, args) func(*args)
finally: finally:
try: try:
self.deletecommand(tmp[0]) self.deletecommand(tmp[0])
...@@ -459,7 +459,7 @@ class Misc: ...@@ -459,7 +459,7 @@ class Misc:
Return an identifier to cancel the scheduling with Return an identifier to cancel the scheduling with
after_cancel.""" after_cancel."""
return apply(self.after, ('idle', func) + args) return self.after('idle', func, *args)
def after_cancel(self, id): def after_cancel(self, id):
"""Cancel scheduling of function identified with ID. """Cancel scheduling of function identified with ID.
...@@ -1182,7 +1182,7 @@ class Misc: ...@@ -1182,7 +1182,7 @@ class Misc:
args = args + (column, row) args = args + (column, row)
if col2 is not None and row2 is not None: if col2 is not None and row2 is not None:
args = args + (col2, row2) args = args + (col2, row2)
return self._getints(apply(self.tk.call, args)) or None return self._getints(self.tk.call(*args)) or None
bbox = grid_bbox bbox = grid_bbox
def _grid_configure(self, command, index, cnf, kw): def _grid_configure(self, command, index, cnf, kw):
...@@ -1324,8 +1324,8 @@ class CallWrapper: ...@@ -1324,8 +1324,8 @@ class CallWrapper:
"""Apply first function SUBST to arguments, than FUNC.""" """Apply first function SUBST to arguments, than FUNC."""
try: try:
if self.subst: if self.subst:
args = apply(self.subst, args) args = self.subst(*args)
return apply(self.func, args) return self.func(*args)
except SystemExit, msg: except SystemExit, msg:
raise SystemExit, msg raise SystemExit, msg
except: except:
...@@ -2028,10 +2028,9 @@ class Canvas(Widget): ...@@ -2028,10 +2028,9 @@ class Canvas(Widget):
args = args[:-1] args = args[:-1]
else: else:
cnf = {} cnf = {}
return getint(apply( return getint(self.tk.call(
self.tk.call, self._w, 'create', itemType,
(self._w, 'create', itemType) *(args + self._options(cnf, kw))))
+ args + self._options(cnf, kw)))
def create_arc(self, *args, **kw): def create_arc(self, *args, **kw):
"""Create arc shaped region with coordinates x1,y1,x2,y2.""" """Create arc shaped region with coordinates x1,y1,x2,y2."""
return self._create('arc', args, kw) return self._create('arc', args, kw)
...@@ -2862,9 +2861,9 @@ class Text(Widget): ...@@ -2862,9 +2861,9 @@ class Text(Widget):
return self._configure(('image', 'configure', index), cnf, kw) return self._configure(('image', 'configure', index), cnf, kw)
def image_create(self, index, cnf={}, **kw): def image_create(self, index, cnf={}, **kw):
"""Create an embedded image at INDEX.""" """Create an embedded image at INDEX."""
return apply(self.tk.call, return self.tk.call(
(self._w, "image", "create", index) self._w, "image", "create", index,
+ self._options(cnf, kw)) *self._options(cnf, kw))
def image_names(self): def image_names(self):
"""Return all names of embedded images in this widget.""" """Return all names of embedded images in this widget."""
return self.tk.call(self._w, "image", "names") return self.tk.call(self._w, "image", "names")
...@@ -3050,7 +3049,7 @@ class _setit: ...@@ -3050,7 +3049,7 @@ class _setit:
def __call__(self, *args): def __call__(self, *args):
self.__var.set(self.__value) self.__var.set(self.__value)
if self.__callback: if self.__callback:
apply(self.__callback, (self.__value,)+args) self.__callback(self.__value, *args)
class OptionMenu(Menubutton): class OptionMenu(Menubutton):
"""OptionMenu which allows the user to select a value from a menu.""" """OptionMenu which allows the user to select a value from a menu."""
...@@ -3156,7 +3155,7 @@ class PhotoImage(Image): ...@@ -3156,7 +3155,7 @@ class PhotoImage(Image):
Valid resource names: data, format, file, gamma, height, palette, Valid resource names: data, format, file, gamma, height, palette,
width.""" width."""
apply(Image.__init__, (self, 'photo', name, cnf, master), kw) Image.__init__(self, 'photo', name, cnf, master, **kw)
def blank(self): def blank(self):
"""Display a transparent image.""" """Display a transparent image."""
self.tk.call(self.name, 'blank') self.tk.call(self.name, 'blank')
...@@ -3215,7 +3214,7 @@ class BitmapImage(Image): ...@@ -3215,7 +3214,7 @@ class BitmapImage(Image):
"""Create a bitmap with NAME. """Create a bitmap with NAME.
Valid resource names: background, data, file, foreground, maskdata, maskfile.""" Valid resource names: background, data, file, foreground, maskdata, maskfile."""
apply(Image.__init__, (self, 'bitmap', name, cnf, master), kw) Image.__init__(self, 'bitmap', name, cnf, master, **kw)
def image_names(): return _default_root.tk.call('image', 'names') def image_names(): return _default_root.tk.call('image', 'names')
def image_types(): return _default_root.tk.call('image', 'types') def image_types(): return _default_root.tk.call('image', 'types')
......
...@@ -63,7 +63,7 @@ def askcolor(color = None, **options): ...@@ -63,7 +63,7 @@ def askcolor(color = None, **options):
options = options.copy() options = options.copy()
options["initialcolor"] = color options["initialcolor"] = color
return apply(Chooser, (), options).show() return Chooser(**options).show()
# -------------------------------------------------------------------- # --------------------------------------------------------------------
......
...@@ -49,7 +49,7 @@ class Dialog: ...@@ -49,7 +49,7 @@ class Dialog:
try: try:
s = apply(w.tk.call, (self.command,) + w._options(self.options)) s = w.tk.call(self.command, *w._options(self.options))
s = self._fixresult(w, s) s = self._fixresult(w, s)
......
...@@ -73,7 +73,7 @@ class Font: ...@@ -73,7 +73,7 @@ class Font:
if not name: if not name:
name = "font" + str(id(self)) name = "font" + str(id(self))
self.name = name self.name = name
apply(root.tk.call, ("font", "create", name) + font) root.tk.call("font", "create", name, *font)
# backlinks! # backlinks!
self._root = root self._root = root
self._split = root.tk.splitlist self._split = root.tk.splitlist
...@@ -90,7 +90,7 @@ class Font: ...@@ -90,7 +90,7 @@ class Font:
def copy(self): def copy(self):
"Return a distinct copy of the current font" "Return a distinct copy of the current font"
return apply(Font, (self._root,), self.actual()) return Font(self._root, **self.actual())
def actual(self, option=None): def actual(self, option=None):
"Return actual font attributes" "Return actual font attributes"
...@@ -108,8 +108,8 @@ class Font: ...@@ -108,8 +108,8 @@ class Font:
def config(self, **options): def config(self, **options):
"Modify font attributes" "Modify font attributes"
if options: if options:
apply(self._call, ("font", "config", self.name) + self._call("font", "config", self.name,
self._set(options)) *self._set(options))
else: else:
return self._mkdict( return self._mkdict(
self._split(self._call("font", "config", self.name)) self._split(self._call("font", "config", self.name))
......
...@@ -72,37 +72,37 @@ def _show(title=None, message=None, icon=None, type=None, **options): ...@@ -72,37 +72,37 @@ def _show(title=None, message=None, icon=None, type=None, **options):
if type: options["type"] = type if type: options["type"] = type
if title: options["title"] = title if title: options["title"] = title
if message: options["message"] = message if message: options["message"] = message
return apply(Message, (), options).show() return Message(**options).show()
def showinfo(title=None, message=None, **options): def showinfo(title=None, message=None, **options):
"Show an info message" "Show an info message"
return apply(_show, (title, message, INFO, OK), options) return _show(title, message, INFO, OK, **options)
def showwarning(title=None, message=None, **options): def showwarning(title=None, message=None, **options):
"Show a warning message" "Show a warning message"
return apply(_show, (title, message, WARNING, OK), options) return _show(title, message, WARNING, OK, **options)
def showerror(title=None, message=None, **options): def showerror(title=None, message=None, **options):
"Show an error message" "Show an error message"
return apply(_show, (title, message, ERROR, OK), options) return _show(title, message, ERROR, OK, **options)
def askquestion(title=None, message=None, **options): def askquestion(title=None, message=None, **options):
"Ask a question" "Ask a question"
return apply(_show, (title, message, QUESTION, YESNO), options) return _show(title, message, QUESTION, YESNO, **options)
def askokcancel(title=None, message=None, **options): def askokcancel(title=None, message=None, **options):
"Ask if operation should proceed; return true if the answer is ok" "Ask if operation should proceed; return true if the answer is ok"
s = apply(_show, (title, message, QUESTION, OKCANCEL), options) s = _show(title, message, QUESTION, OKCANCEL, **options)
return s == OK return s == OK
def askyesno(title=None, message=None, **options): def askyesno(title=None, message=None, **options):
"Ask a question; return true if the answer is yes" "Ask a question; return true if the answer is yes"
s = apply(_show, (title, message, QUESTION, YESNO), options) s = _show(title, message, QUESTION, YESNO, **options)
return s == YES return s == YES
def askretrycancel(title=None, message=None, **options): def askretrycancel(title=None, message=None, **options):
"Ask if operation should be retried; return true if the answer is yes" "Ask if operation should be retried; return true if the answer is yes"
s = apply(_show, (title, message, WARNING, RETRYCANCEL), options) s = _show(title, message, WARNING, RETRYCANCEL, **options)
return s == RETRY return s == RETRY
......
...@@ -249,7 +249,7 @@ def askinteger(title, prompt, **kw): ...@@ -249,7 +249,7 @@ def askinteger(title, prompt, **kw):
Return value is an integer Return value is an integer
''' '''
d = apply(_QueryInteger, (title, prompt), kw) d = _QueryInteger(title, prompt, **kw)
return d.result return d.result
class _QueryFloat(_QueryDialog): class _QueryFloat(_QueryDialog):
...@@ -268,7 +268,7 @@ def askfloat(title, prompt, **kw): ...@@ -268,7 +268,7 @@ def askfloat(title, prompt, **kw):
Return value is a float Return value is a float
''' '''
d = apply(_QueryFloat, (title, prompt), kw) d = _QueryFloat(title, prompt, **kw)
return d.result return d.result
class _QueryString(_QueryDialog): class _QueryString(_QueryDialog):
...@@ -300,7 +300,7 @@ def askstring(title, prompt, **kw): ...@@ -300,7 +300,7 @@ def askstring(title, prompt, **kw):
Return value is a string Return value is a string
''' '''
d = apply(_QueryString, (title, prompt), kw) d = _QueryString(title, prompt, **kw)
return d.result return d.result
if __name__ == "__main__": if __name__ == "__main__":
......
...@@ -354,11 +354,11 @@ def right(angle): _getpen().right(angle) ...@@ -354,11 +354,11 @@ def right(angle): _getpen().right(angle)
def up(): _getpen().up() def up(): _getpen().up()
def down(): _getpen().down() def down(): _getpen().down()
def width(width): _getpen().width(width) def width(width): _getpen().width(width)
def color(*args): apply(_getpen().color, args) def color(*args): _getpen().color(*args)
def write(arg, move=0): _getpen().write(arg, move) def write(arg, move=0): _getpen().write(arg, move)
def fill(flag): _getpen().fill(flag) def fill(flag): _getpen().fill(flag)
def circle(radius, extent=None): _getpen().circle(radius, extent) def circle(radius, extent=None): _getpen().circle(radius, extent)
def goto(*args): apply(_getpen().goto, args) def goto(*args): _getpen().goto(*args)
def heading(): return _getpen().heading() def heading(): return _getpen().heading()
def setheading(angle): _getpen().setheading(angle) def setheading(angle): _getpen().setheading(angle)
def position(): return _getpen().position() def position(): return _getpen().position()
......
...@@ -37,7 +37,7 @@ class _MediaDescriptionCodec: ...@@ -37,7 +37,7 @@ class _MediaDescriptionCodec:
if cod: if cod:
value = cod(value) value = cod(value)
list.append(value) list.append(value)
rv = apply(struct.pack, tuple(list)) rv = struct.pack(*list)
return rv return rv
# Helper functions # Helper functions
......
...@@ -566,7 +566,7 @@ def GetArgv(optionlist=None, commandlist=None, addoldfile=1, addnewfile=1, addfo ...@@ -566,7 +566,7 @@ def GetArgv(optionlist=None, commandlist=None, addoldfile=1, addnewfile=1, addfo
return newlist return newlist
finally: finally:
if hasattr(MacOS, 'SchedParams'): if hasattr(MacOS, 'SchedParams'):
apply(MacOS.SchedParams, appsw) MacOS.SchedParams(*appsw)
del d del d
def _process_Nav_args(dftflags, **args): def _process_Nav_args(dftflags, **args):
...@@ -829,7 +829,7 @@ def test(): ...@@ -829,7 +829,7 @@ def test():
finally: finally:
del bar del bar
if hasattr(MacOS, 'SchedParams'): if hasattr(MacOS, 'SchedParams'):
apply(MacOS.SchedParams, appsw) MacOS.SchedParams(*appsw)
if __name__ == '__main__': if __name__ == '__main__':
try: try:
......
...@@ -166,7 +166,7 @@ class Application: ...@@ -166,7 +166,7 @@ class Application:
def mainloop(self, mask = everyEvent, wait = None): def mainloop(self, mask = everyEvent, wait = None):
self.quitting = 0 self.quitting = 0
if hasattr(MacOS, 'SchedParams'): if hasattr(MacOS, 'SchedParams'):
saveparams = apply(MacOS.SchedParams, self.schedparams) saveparams = MacOS.SchedParams(*self.schedparams)
try: try:
while not self.quitting: while not self.quitting:
try: try:
...@@ -178,7 +178,7 @@ class Application: ...@@ -178,7 +178,7 @@ class Application:
break break
finally: finally:
if hasattr(MacOS, 'SchedParams'): if hasattr(MacOS, 'SchedParams'):
apply(MacOS.SchedParams, saveparams) MacOS.SchedParams(*saveparams)
def dopendingevents(self, mask = everyEvent): def dopendingevents(self, mask = everyEvent):
"""dopendingevents - Handle all pending events""" """dopendingevents - Handle all pending events"""
...@@ -233,7 +233,7 @@ class Application: ...@@ -233,7 +233,7 @@ class Application:
old = self._doing_asyncevents old = self._doing_asyncevents
if old: if old:
MacOS.SetEventHandler() MacOS.SetEventHandler()
apply(MacOS.SchedParams, self.schedparams) MacOS.SchedParams(*self.schedparams)
if onoff: if onoff:
MacOS.SetEventHandler(self.dispatch) MacOS.SetEventHandler(self.dispatch)
doint, dummymask, benice, howoften, bgyield = \ doint, dummymask, benice, howoften, bgyield = \
......
...@@ -155,10 +155,10 @@ class AEServer: ...@@ -155,10 +155,10 @@ class AEServer:
# The try/except that used to be here can mask programmer errors. # The try/except that used to be here can mask programmer errors.
# Let the program crash, the programmer can always add a **args # Let the program crash, the programmer can always add a **args
# to the formal parameter list. # to the formal parameter list.
rv = apply(_function, (_object,), _parameters) rv = _function(_object, **_parameters)
else: else:
#Same try/except comment as above #Same try/except comment as above
rv = apply(_function, (), _parameters) rv = _function(**_parameters)
if rv == None: if rv == None:
aetools.packevent(_reply, {}) aetools.packevent(_reply, {})
......
...@@ -86,10 +86,10 @@ class ArgvCollector: ...@@ -86,10 +86,10 @@ class ArgvCollector:
# The try/except that used to be here can mask programmer errors. # The try/except that used to be here can mask programmer errors.
# Let the program crash, the programmer can always add a **args # Let the program crash, the programmer can always add a **args
# to the formal parameter list. # to the formal parameter list.
rv = apply(_function, (_object,), _parameters) rv = _function(_object, **_parameters)
else: else:
#Same try/except comment as above #Same try/except comment as above
rv = apply(_function, (), _parameters) rv = _function(**_parameters)
if rv == None: if rv == None:
aetools.packevent(_reply, {}) aetools.packevent(_reply, {})
......
...@@ -42,7 +42,7 @@ import __builtin__ ...@@ -42,7 +42,7 @@ import __builtin__
_builtin_open = globals().get('_builtin_open', __builtin__.open) _builtin_open = globals().get('_builtin_open', __builtin__.open)
def _open_with_typer(*args): def _open_with_typer(*args):
file = apply(_builtin_open, args) file = _builtin_open(*args)
filename = args[0] filename = args[0]
mode = 'r' mode = 'r'
if args[1:]: if args[1:]:
......
...@@ -12,7 +12,7 @@ def timefunc(n, func, *args, **kw): ...@@ -12,7 +12,7 @@ def timefunc(n, func, *args, **kw):
t0 = time.clock() t0 = time.clock()
try: try:
for i in range(n): for i in range(n):
result = apply(func, args, kw) result = func(*args, **kw)
return result return result
finally: finally:
t1 = time.clock() t1 = time.clock()
......
...@@ -26,7 +26,7 @@ def window_funcs(stdscr): ...@@ -26,7 +26,7 @@ def window_funcs(stdscr):
for meth in [stdscr.addch, stdscr.addstr]: for meth in [stdscr.addch, stdscr.addstr]:
for args in [('a'), ('a', curses.A_BOLD), for args in [('a'), ('a', curses.A_BOLD),
(4,4, 'a'), (5,5, 'a', curses.A_BOLD)]: (4,4, 'a'), (5,5, 'a', curses.A_BOLD)]:
apply(meth, args) meth(*args)
for meth in [stdscr.box, stdscr.clear, stdscr.clrtobot, for meth in [stdscr.box, stdscr.clear, stdscr.clrtobot,
stdscr.clrtoeol, stdscr.cursyncup, stdscr.delch, stdscr.clrtoeol, stdscr.cursyncup, stdscr.delch,
......
...@@ -1902,7 +1902,7 @@ def _get_StringIO(): ...@@ -1902,7 +1902,7 @@ def _get_StringIO():
return StringIO() return StringIO()
def _do_pulldom_parse(func, args, kwargs): def _do_pulldom_parse(func, args, kwargs):
events = apply(func, args, kwargs) events = func(*args, **kwargs)
toktype, rootNode = events.getEvent() toktype, rootNode = events.getEvent()
events.expandNode(rootNode) events.expandNode(rootNode)
events.clear() events.clear()
......
...@@ -112,7 +112,10 @@ PyDoc_STRVAR(apply_doc, ...@@ -112,7 +112,10 @@ PyDoc_STRVAR(apply_doc,
\n\ \n\
Call a callable object with positional arguments taken from the tuple args,\n\ Call a callable object with positional arguments taken from the tuple args,\n\
and keyword arguments taken from the optional dictionary kwargs.\n\ and keyword arguments taken from the optional dictionary kwargs.\n\
Note that classes are callable, as are instances with a __call__() method."); Note that classes are callable, as are instances with a __call__() method.\n\
\n\
Deprecated since release 2.3. Instead, use the extended call syntax:\n\
function(*args, **keywords).");
static PyObject * static PyObject *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment