New submission from Adrian Dries :
Since Python 3.7 logging.handlers.QueueHandler logs tracebacks twice::
>>> import logging
>>> from logging.handlers import QueueHandler, QueueListener
>>> from queue import Queue
>>> q = Queue()
>>>
Adrian Dries added the comment:
Have your cake and eat it:
def submit(self, fn, args, kw):
# submit implementation
def sugar(*args, **kw):
return args[0].submit(args[1], args[2:], kw)
--
___
Python tracker
<http://bugs.python.
Adrian Dries added the comment:
No, private mangling applies to any identifier in class-scope:
Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
Adrian Dries added the comment:
The futures case is one example of a broader API design issue.
Note also that 'self' is similarly restricted. You might think these are
'corner cases', but to me it is poor API design. There may well be a
reasonable case for passing
Adrian Dries added the comment:
What now?
Python 3.1.3 (r313:86834, Jan 17 2011, 22:33:40)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> def foo(f, **kw):
... pass
...
>>> fo
New submission from Adrian Dries :
An API such as in, e.g. futures:
def submit(self, fn, *args, **kwargs):
pass
cannot be used thus:
submit(foo, 1, 2, fn=bar)
I can see two options: either mangle the named parameters:
def submit(__self, __fn, *args, **kwargs):
pass
Or