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 rep...@bugs.python.org
http://bugs.python.org/issue4331
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 unsure of:
1
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, **keywords
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 partialmethod directly
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
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
(https
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 rep...@bugs.python.org
http://bugs.python.org/issue7317
alon horev alo...@gmail.com added the comment:
after #14969 has closed, can this be closed? any more action items?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14963
alon horev alo...@gmail.com 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
alon horev alo...@gmail.com 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 rep...@bugs.python.org
http
alon horev alo...@gmail.com 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
from Y
alon horev alo...@gmail.com 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.patch
alon horev alo...@gmail.com added the comment:
how does one get his patch reviewed? (it's been 6 months)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7317
alon horev alo...@gmail.com added the comment:
Submitting a patch proposing this format:
-BEGIN UNRAISABLE EXCEPTION-
Class: AttributeError
Instance: 'NoneType' object has no attribute 'someattr'
Function: bound method A.__del__ of __main__.A object at 0x1007671d0
Traceback (most recent
alon horev alo...@gmail.com added the comment:
Here's the next attempt (took your advice about the convention):
Exception ignored in: bound method A.__del__ of __main__.A object at
0x1007671d0
Traceback (most recent call last):
File /tmp/bla.py, line 4, in __del__
None.someattr
Changes by alon horev alo...@gmail.com:
--
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
16 matches
Mail list logo