[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2017-01-04 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: It worries me that nothing in the Python docs nor in any PEP describes how tp_new is inherited. In my opinion, ​this patch makes a significant change which should be subject to a PEP. However, neither the old nor new behaviour is described anywhere. This also

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, it was what the patch did by setting tp_new to slot_tp_new. The problem is that the same code is used for inherited __new__ and assigned in class body. It is hard to distinguish between these cases. In any case I think that Cython shouldn't generate tri

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-14 Thread Benjamin Peterson
Benjamin Peterson added the comment: BTW, at least for #25731, I think the right approach in the MI case is to synthesize a __new__ on the subclass that calls the solid base __new__. -- ___ Python tracker _

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-14 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- priority: release blocker -> normal ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset f89ef18f9824 by Serhiy Storchaka in branch '2.7': Issue #5322: Restored tests for __new__. https://hg.python.org/cpython/rev/f89ef18f9824 New changeset 06e4b9f2e4b0 by Serhiy Storchaka in branch '3.5': Revert changeset 1f31bf3f76f5 (issue5322) excep

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-14 Thread STINNER Victor
STINNER Victor added the comment: Since this change seems to break the backward compatibility, is it safe to apply it to Python 3.5.x and Python 3.6.x? The bug was reported in 2009, 7 years ago. Can the fix wait for Python 3.7? test_file contains code which worked well before the change and st

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5315db3171b0 by Benjamin Peterson in branch '2.7': revert a37cc3d926ec (#5322) https://hg.python.org/cpython/rev/5315db3171b0 -- ___ Python tracker

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-12 Thread Guido van Rossum
Changes by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-12 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: Wouldn't it be possible to fix assignment of __new__ without breaking backwards compatibility (and then apply the same patch for all Python versions)? I have a feeling that breaking the auto-detection of tp_new is a new bug introduced by this patch and not a f

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Jeroen. It looks to me that all problems can be resolved by reordering base classes and making Cython not generating trivial __new__. But that is possible only in new Python version. In maintained versions we should keep the old behavior for backwa

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-12 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: @serhiy.storchaka: yes, changing the order of the base classes fixes the issue with __new__. Also manually assigning __new__ works, like class C(A, B): __new__ = B.__new__ What is broken by this patch is only the auto-detection of which __new__ (really, w

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-12 Thread Matthias Klose
Matthias Klose added the comment: https://trac.sagemath.org/ticket/22037 reports about another regression. -- nosy: +doko ___ Python tracker ___ __

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-12 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- versions: +Python 2.7 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-12 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- keywords: -patch stage: patch review -> ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Does changing the order of base classes help or there is an unavoidable conflict? -- ___ Python tracker ___ __

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-11 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: -pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-11 Thread Jeroen Demeyer
Jeroen Demeyer added the comment: Here is more minimal breaking example. This clearly shows that this patch breaks backwards compatibility. ``` $ cat obj.pyx cdef class OBJ(object): pass $ ipython Python 2.7.13rc1 (default, Dec 11 2016, 14:21:24) Type "copyright", "credits" or "license" f

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-10 Thread Tobias Hansen
Tobias Hansen added the comment: This change breaks backward compatibility in Python 2.7. This is the example that also broke in #25731. In that case the change was reverted. See https://bugs.python.org/issue25731#msg262922 $ cat foo.pxd cdef class B: cdef object b $ cat foo.pyx cdef cla

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4a610bc8577b by Serhiy Storchaka in branch '3.5': Change order of io.UnsupportedOperation base classes. https://hg.python.org/cpython/rev/4a610bc8577b -- ___ Python tracker

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The test is fixed if change order of base classes of UnsupportedOperation. This is rather a workaround, we should find more general fix. -- Added file: http://bugs.python.org/file45784/UnsupportedOperation-bases-order.patch _

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-07 Thread STINNER Victor
STINNER Victor added the comment: test_file started to crash after the change "Issue #5322: Fixed setting __new__ to a PyCFunction inside Python code." :-/ (so all buildbots became red.) Can someone fix it or revert it? (Sorry, I don't have the bandwith right to investigate the crash.) --

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1f31bf3f76f5 by Serhiy Storchaka in branch '3.5': Issue #5322: Fixed setting __new__ to a PyCFunction inside Python code. https://hg.python.org/cpython/rev/1f31bf3f76f5 New changeset 747de8acb7e4 by Serhiy Storchaka in branch '3.6': Issue #5322: Fix

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Will commit to 3.5-3.7 after releasing 3.6.0. -- versions: -Python 2.7 ___ Python tracker ___ ___

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-12-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset a37cc3d926ec by Serhiy Storchaka in branch '2.7': Issue #5322: Fixed setting __new__ to a PyCFunction inside Python code. https://hg.python.org/cpython/rev/a37cc3d926ec -- nosy: +python-dev ___ Python tra

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-11-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-11-17 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file45526/update_one_slot2-2.7.patch ___ Python tracker ___ ___ Python-bugs-li

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-11-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here are updated patches with tests for 3.x and 2.7. -- components: +Interpreter Core nosy: +serhiy.storchaka stage: -> patch review versions: +Python 2.7, Python 3.5, Python 3.6, Python 3.7 -Python 2.6 Added file: http://bugs.python.org/file45525/upd

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2011-10-09 Thread Benjamin Peterson
Benjamin Peterson added the comment: I think it needs tests. -- nosy: +benjamin.peterson ___ Python tracker ___ ___ Python-bugs-list m

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2009-05-06 Thread Stefan Ring
Changes by Stefan Ring : -- nosy: +Ringding ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2009-04-27 Thread Trundle
Trundle added the comment: See also issue #1694663. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2009-04-26 Thread Trundle
Changes by Trundle : -- nosy: +gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2009-04-18 Thread Trundle
Trundle added the comment: The problem is that `type_setattro()` sets the new "__new__" attribute in the type's dict (through `PyObject_GenericSetAttr()`), but the corresponding slot will never be updated if the new "__new__" is a PyCFunction. The affected code in `update_one_slot()` was added

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2009-04-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm sorry, I don't have any opinion on this. -- assignee: pitrou -> ___ Python tracker ___ ___ Pyth

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2009-04-09 Thread Georg Brandl
Changes by Georg Brandl : -- assignee: -> pitrou nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2009-03-24 Thread Sebastian Ramacher
Changes by Sebastian Ramacher : -- nosy: +sebastinas ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2009-03-24 Thread Trundle
Trundle added the comment: I think the real problem here is `update_one_slot` and not `object_new`. It is impossible to set "__new__" to a PyCFunction inside Python code, which may be a feature, but is in fact very irritating. For example the following snippet: >>> class Dict(dict): __new__ =

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2009-02-26 Thread James Mills
Changes by James Mills : -- nosy: +prologic ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2009-02-19 Thread Armin Ronacher
Armin Ronacher added the comment: The problem seems to be caused by tp_new being slot_tp_new which then invokes whatever __new__ in the class dict is. I'm not so sure what would be the solution to this. One could of course check if tp_new is either object_new or slot_tp_new and in the latter c

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2009-02-19 Thread Armin Ronacher
New submission from Armin Ronacher : In 2.6 a deprecation warning was added if `object.__new__` was called with arguments. Per se this is fine, but the detection seems to be faulty. The following code shows the problem: >>> class A(object): ... def __new__(self): ... raise TypeErro