[issue33899] Tokenize module does not mirror "end-of-input" is newline behavior

2019-03-22 Thread Brecht Machiels
Brecht Machiels added the comment: In order to adapt code to this change, can we assume that a NEWLINE token with an empty string only occurs right before the ENDMARKER? -- nosy: +brechtm ___ Python tracker <https://bugs.python.org/issue33

[issue30053] Problems building with --enable-profiling on macOS

2017-04-12 Thread Brecht Machiels
Changes by Brecht Machiels <bre...@mos6581.org>: Added file: http://bugs.python.org/file46800/make_gcc.txt ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue30053] Problems building with --enable-profiling on macOS

2017-04-12 Thread Brecht Machiels
Changes by Brecht Machiels <bre...@mos6581.org>: Added file: http://bugs.python.org/file46799/make.txt ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue30053] Problems building with --enable-profiling on macOS

2017-04-12 Thread Brecht Machiels
New submission from Brecht Machiels: The python.exe produced during the build process is somehow broken: $ ./python.exe -S Killed: 9 Strangely, it works when run from gdb: $ gdb -args ./python.exe -S GNU gdb (GDB) 7.12.1 Copyright (C) 2017 Free Software Foundation, Inc

[issue29994] site.USER_SITE is None for Windows embeddable Python 3.6

2017-04-12 Thread Brecht Machiels
Brecht Machiels added the comment: I see. In that case I think pip should be able to handle the case when site.USER_SITE is None. I have created a ticket here: https://github.com/pypa/pip/issues/4437. I am using the embeddable Python what's it intended for, to make a self-contained

[issue29994] site.USER_SITE is None for Windows embeddable Python 3.6

2017-04-05 Thread Brecht Machiels
New submission from Brecht Machiels: Previous versions of the embeddable Python: Python 3.5.3 (v3.5.3:1880cb95a742, Jan 16 2017, 16:02:32) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" f

[issue24806] Inheriting from NoneType does not fail consistently

2015-08-06 Thread Brecht Machiels
New submission from Brecht Machiels: These both raise an exception: class Null(type(None)): pass class Null(object, type(None)): pass The following does not: class Object(object): pass class Null(Object, type(None)): pass This should also raise a TypeError. Also, the result

[issue24806] Inheriting from NoneType does not fail consistently

2015-08-06 Thread Brecht Machiels
Brecht Machiels added the comment: Ok. I was afraid a fix for this might affect class Integer(Object, int). Good to hear it shouldn't. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24806

[issue24806] Inheriting from NoneType does not fail consistently

2015-08-06 Thread Brecht Machiels
Brecht Machiels added the comment: Similar inconsistent behavior for: class Object(object): pass class Integer(Object, int): pass versus class Integer(object, int): pass However, I'm successfully using the first version, which saves some boilerplate code for emulating ints

[issue24806] Inheriting from NoneType does not fail consistently

2015-08-06 Thread Brecht Machiels
Brecht Machiels added the comment: This is a real-world example where this type of inheritance is used: https://github.com/brechtm/rinohtype/blob/8bd961243c1059aa7cb738493e4687f7a5930d5b/rinoh/backend/pdf/cos.py#L121 I don't think there is any inherent reason not to subclass from (indirectly

[issue22879] Make set's add and discard methods return useful information

2014-11-15 Thread Brecht Machiels
New submission from Brecht Machiels: set's add() method would be a little bit more useful if it would return True if the added value was already present in the set, and False if it wasn't (or the other way around). Similarly, discard() could report whether the discarded value was present

[issue14373] C implementation of functools.lru_cache

2013-11-21 Thread Brecht Machiels
Brecht Machiels added the comment: What's the status of this patch? What still needs to be done for it to be accepted? -- nosy: +brechtm ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14373

[issue19483] Pure-Python ElementTree classes no longer available since 3.3

2013-11-03 Thread Brecht Machiels
New submission from Brecht Machiels: With Python 3.2, I subclassed ElementTree.XMLParser to set ExternalEntityRefHandler on the XMLParser's (expat) 'parser' member. I understand the 'parser' member is not part of the public API, but this was the only way to customize the parser without having

[issue19483] Pure-Python ElementTree classes no longer available since 3.3

2013-11-03 Thread Brecht Machiels
Brecht Machiels added the comment: You can import the pure python version in cPython by blocking the import of the C accelerator: import sys sys.modules['_elementtree'] = None import xml.etree.ElementTree This will not work if xml.etree.ElementTree was already imported by another

[issue14630] non-deterministic behavior of int subclass

2012-04-20 Thread Brecht Machiels
New submission from Brecht Machiels bre...@mos6581.org: I have subclassed int to add an extra attribute: class Integer(int): def __new__(cls, value, base=10, indirect=False): try: obj = int.__new__(cls, value, base) except TypeError: obj = int.__new__