[issue4331] Add functools.partialmethod

2013-10-29 Thread alon horev
alon horev added the comment: I've changed the test according to the code review. Thanks -- Added file: http://bugs.python.org/file32409/4331.v2.patch ___ Python tracker <http://bugs.python.org/i

[issue4331] Add functools.partialmethod

2013-10-28 Thread alon horev
alon horev added the comment: Adding a patch with tests and documentation. Please feel free to comment on anything: my English, coding/testing style. I'm pretty sure the documentation can be better but it turns out I speak better Python than English. Two decisions I've made and un

[issue4331] Add functools.partialmethod

2013-10-27 Thread alon horev
alon horev added the comment: I think the following test demonstrates the API we're looking for. 1. Am I missing any functionality? 2. How does partialmethod relate to @absolutemethod? from functools import partial class partialmethod(object): def __init__(self, func, *args, **key

[issue4331] Add functools.partialmethod

2013-10-26 Thread alon horev
alon horev added the comment: Here's another attempt at a consistent api with regular methods. I'm contemplating whether partialmethod should support __call__. Given the fact partial is used to bind positional arguments, it will do the 'wrong' thing when calling the partia

[issue4331] Add functools.partialmethod

2013-10-25 Thread alon horev
alon horev added the comment: I just want to make sure I understand the semantics concerning class methods, the following example demonstrates a usage similar to regular methods as much as possible: class A(object): def add(self, x, y): print(self) return x + y add10

[issue19080] Enrich SyntaxError with additional information

2013-09-23 Thread alon horev
New submission from alon horev: Some context for this feature request: I'm using the wonderful ast module for a library that translates python code to MongoDB queries (https://github.com/alonho/pql). I also did the same for SQL queries using sqlalchemy as a part of another project (

[issue7317] Display full tracebacks when an error occurs asynchronously

2012-10-31 Thread alon horev
alon horev added the comment: Hi Antoine, can you please have a look at the patch? It's been over a year since it's submitted. (-: thanks! -- ___ Python tracker <http://bugs.python.

[issue14963] Use an iterative implementation for contextlib.ExitStack.__exit__

2012-06-02 Thread alon horev
alon horev added the comment: after #14969 has closed, can this be closed? any more action items? -- ___ Python tracker <http://bugs.python.org/issue14

[issue14969] Use __suppress_context__ in contextlib.ExitStack.__exit__

2012-06-01 Thread alon horev
alon horev added the comment: Ok, so turns out this was just a stupid bug: we set the __context__ attr only if an exception is raised, but not when an exception has been previously 'cleared'. so the context is filled (by python) with the last exception raised which is the outer one

[issue14969] Restore sys.exc_clear()?

2012-05-31 Thread alon horev
alon horev added the comment: Another possible solution is to explicitly set an exception's __supress_context__ attribute to False (right now impossible because it's the default value). If a user can 'turn on' the flag when attaching a different exception (raise X fr

[issue14963] Use an iterative implementation for contextlib.ExitStack.__exit__

2012-05-31 Thread alon horev
alon horev added the comment: that was indeed trickier, but overriding the __context__ attribute did the trick. -- Added file: http://bugs.python.org/file25770/14963.2.patch ___ Python tracker <http://bugs.python.org/issue14

[issue14963] Use an iterative implementation for contextlib.ExitStack.__exit__

2012-05-30 Thread alon horev
alon horev added the comment: The iterative approach turned out elegant and concise. It actually now resembeles the implementation of nested's __exit__. -- keywords: +patch nosy: +alonho Added file: http://bugs.python.org/file25763/14963.

[issue7317] Display full tracebacks when an error occurs asynchronously

2012-05-12 Thread alon horev
alon horev added the comment: how does one get his patch reviewed? (it's been 6 months) -- ___ Python tracker <http://bugs.python.org/issue7317> ___ ___

[issue7317] Display full tracebacks when an error occurs asynchronously

2011-10-15 Thread alon horev
alon horev added the comment: Here's the next attempt (took your advice about the convention): Exception ignored in: > Traceback (most recent call last): File "/tmp/bla.py", line 4, in __del__ None.someattr AttributeError: 'NoneType' object has no attribute

[issue7317] Display full tracebacks when an error occurs asynchronously

2011-10-15 Thread alon horev
alon horev added the comment: Submitting a patch proposing this format: -BEGIN UNRAISABLE EXCEPTION- Class: AttributeError Instance: "'NoneType' object has no attribute 'someattr'" Function: > Traceback (most recent call last): File "/tmp/bla.py&

[issue8733] list type and UserList do not call super in __init__ and therefore, they cannot be parents in a multiple inheritence scheme

2010-05-16 Thread alon horev
Changes by alon horev : -- components: Extension Modules nosy: alonho priority: normal severity: normal status: open title: list type and UserList do not call super in __init__ and therefore, they cannot be parents in a multiple inheritence scheme type: behavior versions: Python 3.3