[issue38941] xml.etree.ElementTree.Element inconsistent warning for bool

2022-03-22 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: I was close to merging the linked PR but there's some renewed concerns about the proposed behavior here: Do we really want to change this behavior and potentially force a lot of people to change their working code? In addition, the current code emits FutureW

[issue38941] xml.etree.ElementTree.Element inconsistent warning for bool

2022-02-05 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue38941] xml.etree.ElementTree.Element inconsistent warning for bool

2022-02-05 Thread Jacob Walls
Change by Jacob Walls : -- keywords: +patch nosy: +jacobtylerwalls nosy_count: 6.0 -> 7.0 pull_requests: +29326 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31149 ___ Python tracker

[issue38941] xml.etree.ElementTree.Element inconsistent warning for bool

2019-12-02 Thread Guido van Rossum
Guido van Rossum added the comment: I doubt effbot will respond. :-) I think the first order of business is to add the same FutureWarning to the C version of the code, and to reset the clock on the deprecation. In terms of the final stages, why wouldn't we want it to just always raise? Jus

[issue38941] xml.etree.ElementTree.Element inconsistent warning for bool

2019-12-02 Thread Philip Rowlands
Philip Rowlands added the comment: I went digging through the archives, made more interesting as elementtree was imported into the standard library. AFAICT, the FutureWarning for __bool__ (or __nonzero__ in py2) appeared circa 2007-06 in version 1.3a2: http://svn.effbot.org/public/tags/eleme

[issue38941] xml.etree.ElementTree.Element inconsistent warning for bool

2019-12-01 Thread Guido van Rossum
Guido van Rossum added the comment: I'm +1 on adding the deprecation and changing it to an error in the future. I think it's an anti-pattern that objects with complex behavior that includes some sequence behavior allow the fallback behavior for checking the empty sequence. I recall being bit

[issue38941] xml.etree.ElementTree.Element inconsistent warning for bool

2019-12-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Stefan's arguments looked reasonable to me. I supported deprecating Element.__bool__. This was an old plan, although we failed with deprecation in the C implementation (this is not the first oversight in deprecations in ElementTree). But there is a proble

[issue38941] xml.etree.ElementTree.Element inconsistent warning for bool

2019-12-01 Thread Stefan Behnel
Stefan Behnel added the comment: Not so quick. :) You're probably aware of the details, but still, let me state clearly what this is about, to make sure that we're all on the same page here. (I'm also asking in Serhiy, because he did quite some work on ET in the past and has experience with it

[issue38941] xml.etree.ElementTree.Element inconsistent warning for bool

2019-11-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: > And, we should finally decide whether this should really be > changed or not. The current behaviour is counter-intuitive, > but it's been like that forever and lots of code depends on > it in one way or another, so … You make a good case to just leave it

[issue38941] xml.etree.ElementTree.Element inconsistent warning for bool

2019-11-29 Thread Philip Rowlands
Philip Rowlands added the comment: It's easier to justify a change in behaviour if the warning is emitted. With no legacy concerns, I would be happy for bool() to change, but I'm not the one who would receive the grumbly tickets. How about emitting the warning in the next release, then asses

[issue38941] xml.etree.ElementTree.Element inconsistent warning for bool

2019-11-29 Thread Stefan Behnel
Stefan Behnel added the comment: Agreed that both should behave the same. And, we should finally decide whether this should really be changed or not. The current behaviour is counter-intuitive, but it's been like that forever and lots of code depends on it in one way or another, so … ---

[issue38941] xml.etree.ElementTree.Element inconsistent warning for bool

2019-11-29 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- components: +XML nosy: +scoder ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue38941] xml.etree.ElementTree.Element inconsistent warning for bool

2019-11-29 Thread Philip Rowlands
New submission from Philip Rowlands : Steps to reproduce: $ python3.7 Python 3.7.2 (default, May 13 2019, 13:52:56) [GCC 6.3.0 20170516] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import xml.etree.ElementTree as ET >>> bool(ET.fromstring("").find(".//c")