[issue13266] Add inspect.unwrap(f) to easily unravel "__wrapped__" chains

2012-11-22 Thread Daniel Urban
Changes by Daniel Urban : -- stage: needs patch -> patch review ___ Python tracker <http://bugs.python.org/issue13266> ___ ___ Python-bugs-list mailing list Un

[issue16538] The docs doesn't describe MAKE_CLOSURE correctly

2012-11-23 Thread Daniel Urban
New submission from Daniel Urban: The documentation of the dis module describes the MAKE_CLOSURE opcode incorrectly. The description of MAKE_FUNCTION was updated in 242d3f8e8c50 (issue14349) to include the qualified name, but MAKE_CLOSURE wan't. A patch is attched. -- assignee:

[issue16546] ast.YieldFrom needlessly has its expr value as optional

2012-11-24 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +daniel.urban ___ Python tracker <http://bugs.python.org/issue16546> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue16545] ast.FunctionDef sets a bad value for kw_defaults when keyword-only arguments present

2012-11-24 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +daniel.urban ___ Python tracker <http://bugs.python.org/issue16545> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue16545] ast.FunctionDef sets a bad value for kw_defaults when keyword-only arguments present

2012-11-24 Thread Daniel Urban
Daniel Urban added the comment: If I understand correctly, the invariant is that len(kw_defaults) == len(kwonlyargs). I think the reason is that the following is valid syntax (an argument without a default after one with a default): >>> def f(*, a=0, b): pass ... >>> And

[issue12457] type() returns incorrect type for nested classes

2012-11-24 Thread Daniel Urban
Daniel Urban added the comment: Also, it seems, that pickling inner classes will by supported by pickle protocol version 4 (see PEP 3154). There is already an issue for the implementation: issue15642. -- versions: +Python 3.4 -Python 2.7, Python 3.2

[issue12457] type() returns incorrect type for nested classes

2012-11-24 Thread Daniel Urban
Changes by Daniel Urban : -- resolution: -> duplicate superseder: -> Integrate pickle protocol version 4 GSoC work by Stefan Mihaila ___ Python tracker <http://bugs.python.org/i

[issue16554] The description of the argument of MAKE_FUNCTION and MAKE_CLOSURE is incorrect

2012-11-25 Thread Daniel Urban
New submission from Daniel Urban: The description of the argument of the MAKE_FUNCTION and MAKE_CLOSURE opcodes in the documentation of the dis module is incorrect. Patch attached. -- assignee: docs@python components: Documentation files: make_function_closure.patch keywords: needs

[issue12370] Use of super overwrites use of __class__ in class namespace

2012-11-26 Thread Daniel Urban
Daniel Urban added the comment: I tried to implement Nick's idea with the separate scope for __class__. It seems to work, I'm attaching a patch. The patch basically causes the following class statement: class C(A, B, metaclass=meta): def f(self): return __class__ To b

[issue12370] Use of super overwrites use of __class__ in class namespace

2012-11-28 Thread Daniel Urban
Daniel Urban added the comment: Thanks for the review! Nick, the example with Outer, InnerParent and InnerChild still works (the evaluation happens before we enter the new scope). Of course you're all right about __args__ and __kw__. I'll try to find a way to hide them. --

[issue16554] The description of the argument of MAKE_FUNCTION and MAKE_CLOSURE is incorrect

2012-11-28 Thread Daniel Urban
Daniel Urban added the comment: Sorry, I won't have time for that in the following weeks. -- ___ Python tracker <http://bugs.python.org/issue16554> ___ ___

[issue16572] Bad multi-inheritance support in some libs like threading or multiprocessing

2012-11-29 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +daniel.urban ___ Python tracker <http://bugs.python.org/issue16572> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue16584] unhandled IOError filecmp.cmpfiles() if file not readable

2012-12-01 Thread Daniel Urban
Changes by Daniel Urban : -- stage: -> patch review type: crash -> behavior ___ Python tracker <http://bugs.python.org/issue16584> ___ ___ Python-bugs-list

[issue16599] unittest: Access test result from tearDown

2012-12-03 Thread Daniel Urban
Changes by Daniel Urban : -- stage: -> needs patch type: -> enhancement versions: +Python 3.4 -Python 2.7, Python 3.1, Python 3.2, Python 3.3 ___ Python tracker <http://bugs.python.org/i

[issue12457] type() returns incorrect type for nested classes

2012-12-04 Thread Daniel Urban
Daniel Urban added the comment: I don't know what is the protocol for duplicates when the superseder is still open. If they should be closed, then I think yes, this should be closed. -- ___ Python tracker <http://bugs.python.org/is

[issue16602] weakref can return an object with 0 refcount

2012-12-04 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +daniel.urban ___ Python tracker <http://bugs.python.org/issue16602> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue16607] Bad examples in documentation

2012-12-04 Thread Daniel Urban
Daniel Urban added the comment: Could you please point to a specific example which is incorrect? Thank you. -- nosy: +daniel.urban ___ Python tracker <http://bugs.python.org/issue16

[issue16607] Bad examples in documentation

2012-12-04 Thread Daniel Urban
Daniel Urban added the comment: Both work fine. -- ___ Python tracker <http://bugs.python.org/issue16607> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue16612] Integrate "Argument Clinic" specialized preprocessor into CPython trunk

2012-12-04 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +daniel.urban ___ Python tracker <http://bugs.python.org/issue16612> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue16619] LOAD_GLOBAL used to load `None` under certain circumstances

2012-12-06 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +daniel.urban ___ Python tracker <http://bugs.python.org/issue16619> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11159] Sax parser crashes if given unicode file name

2012-12-08 Thread Daniel Urban
Changes by Daniel Urban : -- type: crash -> behavior ___ Python tracker <http://bugs.python.org/issue11159> ___ ___ Python-bugs-list mailing list Unsubscri

[issue12915] Add inspect.locate and inspect.resolve

2012-12-10 Thread Daniel Urban
Changes by Daniel Urban : -- stage: test needed -> patch review ___ Python tracker <http://bugs.python.org/issue12915> ___ ___ Python-bugs-list mailing list Un

[issue16607] Bad examples in documentation

2012-12-13 Thread Daniel Urban
Daniel Urban added the comment: As John Hampton have explained it, the documentation is actually correct. -- status: open -> closed ___ Python tracker <http://bugs.python.org/issu

[issue16832] Expose cache validity checking support in ABCMeta

2013-01-01 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +daniel.urban ___ Python tracker <http://bugs.python.org/issue16832> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue16839] segmentation fault when unicode(classic_class_instance)

2013-01-02 Thread Daniel Urban
Changes by Daniel Urban : -- stage: -> patch review ___ Python tracker <http://bugs.python.org/issue16839> ___ ___ Python-bugs-list mailing list Unsubscri

[issue16894] Function attribute access doesn't invoke methods in dict subclasses

2013-01-10 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +daniel.urban ___ Python tracker <http://bugs.python.org/issue16894> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17044] Implement PEP 422: Simple class initialisation hook

2013-01-26 Thread Daniel Urban
New submission from Daniel Urban: The attached patch implements PEP 422 -- Simple class initialisation hook (__init_class__). It includes tests, but it doesn't include documentation yet. -- components: Interpreter Core, Library (Lib) files: pep422_1.patch keywords: needs review,

[issue17044] Implement PEP 422: Simple class initialisation hook

2013-01-26 Thread Daniel Urban
Daniel Urban added the comment: Thanks for the review Ezio! I've fixed the order of the arguments of assertEqual. Regarding your other comment: I agree that your code is shorter and clearer, but it doesn't do exactly the same thing. cls.__init_class__ can be None, and in that case,

[issue17044] Implement PEP 422: Simple class initialisation hook

2013-01-30 Thread Daniel Urban
Daniel Urban added the comment: I'm attaching a new patch with some documentation and one additional test. -- Added file: http://bugs.python.org/file28912/pep422_3.patch ___ Python tracker <http://bugs.python.org/is

[issue19022] Improve handling of type.__abstractmethods__ descriptor

2013-09-22 Thread Daniel Urban
Daniel Urban added the comment: I like the 3rd alternative the most. It seems to me, that __abstractmethods__ is currently an undocumented implementation detail of ABCs. The 1st alternative would cause every type to have an empty __abstractmethods__ (which is technically correct, but probably

[issue19072] classmethod doesn't honour descriptor protocol of wrapped callable

2013-09-29 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +daniel.urban ___ Python tracker <http://bugs.python.org/issue19072> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue7244] itertools.zip_longest behaves strangely with an iterable class

2009-10-31 Thread Daniel Urban
New submission from Daniel Urban : I'm trying to write an iterable class, and it behaves strangely with itertools.zip_longest. The following example demonstrates this: class Repeater: # this class is similar to itertools.repeat def __init__(self, o, t): self.o = o self.t

[issue7244] itertools.zip_longest behaves strangely with an iterable class

2009-10-31 Thread Daniel Urban
Daniel Urban added the comment: > I saw strange thing with following code + release26-maint/trunk. I tried your code (with the new-style class) with Python 2.6.4 and 2.7a0 (trunk), and both worked fine. I built them with GCC 4.2.4 on Ubuntu 8

[issue8699] Equality and hashing for functools.partial

2010-05-16 Thread Daniel Urban
Daniel Urban added the comment: In this new patch, __eq__ compares also the __dict__ of the two partial instances. -- Added file: http://bugs.python.org/file17363/partial_eq_hash_4.diff ___ Python tracker <http://bugs.python.org/issue8

[issue5094] datetime lacks concrete tzinfo impl. for UTC

2010-06-05 Thread Daniel Urban
Daniel Urban added the comment: Isn't it possible, that in the issue5094b.diff patch, in the new_timezone_ex function, in this part: self = (PyDateTime_TimeZone *)type->tp_alloc(type, 0); if (self == NULL) return NULL; should be a Py_DECREF(offset) call? I mean lik

[issue8916] Move PEP 362 (function signature objects) into inspect

2010-06-06 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue8916> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue7989] Transition time/datetime C modules to Python

2010-06-07 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue7989> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5094] datetime lacks concrete tzinfo impl. for UTC

2010-06-07 Thread Daniel Urban
Daniel Urban added the comment: In Doc/library/datetime.rst, in the documentation of datetime.utcnow this part: ".. versionchanged:: 2.7" probably should be ".. versionchanged:: 3.2". -- ___ Python tracker <http://bu

[issue8998] add crypto routines to stdlib

2010-06-15 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue8998> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue8998] add crypto routines to stdlib

2010-06-17 Thread Daniel Urban
Daniel Urban added the comment: > * When I have thought about Python crypto in the stdlib, I've considered > modeling it after hashlib, so you would get cipher = cryptolib.AES(bits=192, > ...) etc. (Caveat: haven't thought it through.) I think there is a relevant PEP:

[issue6507] Enhance dis.dis to autocompile codestrings

2010-07-02 Thread Daniel Urban
Daniel Urban added the comment: > disassemble_string should've been private as well, while we are editing this > module. Attached the updated patch. -- Added file: http://bugs.python.org/file17839/issue6507_3.diff ___ Python tra

[issue9147] dis.show_code() variant that accepts source strings (and returns rather than prints)

2010-07-03 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue9147> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9204] The documentation of PyType_Type in py3k mentions types.TypeType

2010-07-08 Thread Daniel Urban
New submission from Daniel Urban : The documentation of PyType_Type (http://docs.python.org/dev/py3k/c-api/type.html#PyType_Type) is this: "This is the type object for type objects; it is the same object as type and types.TypeType in the Python layer." But in py3k there is no type

[issue9213] range purports to implement the Sequence ABC, but is missing index and count methods

2010-07-21 Thread Daniel Urban
Daniel Urban added the comment: The attached patch adds the range.count and range.index methods. Pseudocode for the two method: def count(self, ob): if ob in self: return 1 else: return 0 def index(self, ob, start=0, stop=len(self)): if ob in self: idx

[issue9213] range purports to implement the Sequence ABC, but is missing index and count methods

2010-07-22 Thread Daniel Urban
Daniel Urban added the comment: Sorry, the previous patch has a reference leak. I'm attaching the fixed patch as issue9213a.diff (I also added a few tests with really big ranges). -- Added file: http://bugs.python.org/file18128/issue9213a

[issue8297] AttributeError message text should include module name

2010-07-22 Thread Daniel Urban
Daniel Urban added the comment: According to PEP 7 [1], all declarations must be at the top of a block. So you probably should move the "char *mod_name_str" and "PyModuleObject *module" declarations to the beginning of the function's body. [1] http://www.pyt

[issue9212] dict_keys purports to implement the Set ABC, but is missing the isdisjoint method

2010-07-23 Thread Daniel Urban
Daniel Urban added the comment: The attached patch adds the isdisjoint method to dict_keys and dict_items. Pseudocode for the method: def isdisjoint(self, other): if self is other: if len(self) == 0: return True else: return False else

[issue8507] abc.abstractproperty does not copy docstring

2010-07-23 Thread Daniel Urban
Daniel Urban added the comment: I tried, and wasn't able to reproduce with py3k (r83091), 3.1.2, release27-maint (r83111), release26-maint (r83111). -- nosy: +durban ___ Python tracker <http://bugs.python.org/i

[issue9212] dict_keys purports to implement the Set ABC, but is missing the isdisjoint method

2010-07-24 Thread Daniel Urban
Daniel Urban added the comment: > Unless there is a reason I have missed, I would iterate through the > smaller set, which might even be empty or nearly so, rather than > either in particular. You're right, here is a new patch. Pseudocode: def isdisjoint(self, other): if

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

2010-07-25 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue8733> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9214] Most Set methods of KeysView and ItemsView do not work right

2010-07-29 Thread Daniel Urban
Daniel Urban added the comment: The patch applies cleanly to the py3k branch (r83238). The unittests pass. The code looks good to me (it does exactly what was described as the solution). There are some trailing whitespace on some lines, that will need to be deleted. -- nosy: +durban

[issue9214] Most Set methods of KeysView and ItemsView do not work right

2010-07-31 Thread Daniel Urban
Daniel Urban added the comment: > P.S. Please let me know how to detect such issues in future patches. In some editors there is an option "Remove trailing spaces" or something like that. Also, some editors (for example Kate) show tr

[issue9533] metaclass can't derive from ABC

2010-08-06 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban type: compile error -> behavior ___ Python tracker <http://bugs.python.org/issue9533> ___ ___ Python-bugs-list mai

[issue9520] Add Patricia Trie high performance container

2010-08-06 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue9520> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9417] Declaring a class creates circular references

2010-08-07 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker <http://bugs.python.org/issue9417> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1294232] Error in metaclass search order

2010-08-08 Thread Daniel Urban
Daniel Urban added the comment: I think the situation is a bit more complicated. Here is the example described by Pedro Werneck (this is py3k, but its essentially the same in 2.x): >>> class M_A(type): ... def __new__(mcls, name, bases, ns): ... print(&#x

[issue17179] Incorrect use of type function in types.new_class

2013-02-14 Thread Daniel Urban
Daniel Urban added the comment: I don't think this is a bug: >>> from datetime import datetime >>> class tdatetime(datetime, foo='bar'): ... pass ... Traceback (most recent call last): File "", line 1, in TypeError: type() takes 1 or 3 ar

[issue17044] Implement PEP 422: Simple class initialisation hook

2013-02-17 Thread Daniel Urban
Daniel Urban added the comment: Thanks for the grammar correction, I've fixed it in the new patch. The new patch also adds object.__init_class__ (which is a no-op), to support cooperative multiple inheritance of __init_class__. (Adding type.__init_class__ was mentioned in the pytho

[issue17044] Implement PEP 422: Simple class initialisation hook

2013-02-17 Thread Daniel Urban
Changes by Daniel Urban : Removed file: http://bugs.python.org/file29097/pep422_4.patch ___ Python tracker <http://bugs.python.org/issue17044> ___ ___ Python-bugs-list m

[issue17044] Implement PEP 422: Simple class initialisation hook

2013-02-17 Thread Daniel Urban
Changes by Daniel Urban : Added file: http://bugs.python.org/file29098/pep422_4.patch ___ Python tracker <http://bugs.python.org/issue17044> ___ ___ Python-bugs-list m

[issue17044] Implement PEP 422: Simple class initialisation hook

2013-02-17 Thread Daniel Urban
Daniel Urban added the comment: Yes, if we would add a regular (instance) method __init_class__ to type, it could (probably) work for regular (non-meta) classes, but not for metaclasses. If a metaclass Meta wouldn't define __init_class__ itself, calling Meta.__init_class__

[issue17044] Implement PEP 422: Simple class initialisation hook

2013-02-17 Thread Daniel Urban
Changes by Daniel Urban : Added file: http://bugs.python.org/file29102/pep422.patch ___ Python tracker <http://bugs.python.org/issue17044> ___ ___ Python-bugs-list mailin

[issue17279] Document which named built-in classes can be subclassed

2013-02-22 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +daniel.urban ___ Python tracker <http://bugs.python.org/issue17279> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11480] Cannot copy a class with a metaclass other than type

2013-02-24 Thread Daniel Urban
Daniel Urban added the comment: I did, and I've been told that it has been added to the bug tracker: http://mail.python.org/pipermail/python-committers/2012-May/001987.html -- ___ Python tracker <http://bugs.python.org/is

[issue17044] Implement PEP 422: Simple class initialisation hook

2013-03-13 Thread Daniel Urban
Daniel Urban added the comment: I've looked into implementing the changes in the new version of the PEP. It seems, that currently type.__new__ copies the dict returned by __prepare__ (http://hg.python.org/cpython/file/55806d234653/Objects/typeobject.c#l2058). I think this means that so

[issue17422] language reference should specify restrictions on class namespace

2013-03-14 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +daniel.urban ___ Python tracker <http://bugs.python.org/issue17422> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17421] Drop restriction that meta.__prepare__() must return a dict (subclass)

2013-03-14 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +daniel.urban ___ Python tracker <http://bugs.python.org/issue17421> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17044] Implement PEP 422: Simple class initialisation hook

2013-04-14 Thread Daniel Urban
Daniel Urban added the comment: I've attached a new patch. With this patch, type.__prepare__ has an optional keyword-only argument 'namespace', and returns it if it's specified. Also, __init_class__ is passed an argument: a mapping proxy of the mapping originally ret

[issue17853] class construction name resolution broken in functions

2013-04-27 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +daniel.urban ___ Python tracker <http://bugs.python.org/issue17853> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue16429] Emit SyntaxWarning for code that risks UnboundLocalError

2013-05-04 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +daniel.urban ___ Python tracker <http://bugs.python.org/issue16429> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17950] Dynamic classes contain non-breakable reference cycles

2013-05-13 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +daniel.urban ___ Python tracker <http://bugs.python.org/issue17950> ___ ___ Python-bugs-list mailing list Unsubscribe:

<    1   2   3