[issue46935] import of submodule polutes global namespace

2022-03-06 Thread Max Bachmann
Max Bachmann added the comment: Thanks Dennis. This helped me track down the issue in rapidfuzz. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46935] import of submodule polutes global namespace

2022-03-05 Thread Max Bachmann
Max Bachmann added the comment: It appears this only occurs when a C Extension is involved. When the so is imported first it is preferred over the .py file that the user would like to import. I could not find any documentation on this behavior, so I assume that this is not the intended. My

[issue46935] import of submodule polutes global namespace

2022-03-05 Thread Max Bachmann
New submission from Max Bachmann : In my environment I installed the following two libraries: ``` pip install rapidfuzz pip install python-Levenshtein ``` Those two libraries have the following structures: rapidfuzz |-distance |- __init__.py (from . import Levenshtein) |- Levenshtein.*.so

[issue45105] Incorrect handling of unicode character \U00010900

2021-09-05 Thread Max Bachmann
Max Bachmann added the comment: As far as a I understood this is caused by the same reason: ``` >>> s = '123\U00010900456' >>> s '123ऀ456' >>> list(s) ['1', '2', '3', 'ऀ', '4', '5', '6'] # note that everything including the commas is mirrored until ] is reached

[issue45105] Incorrect handling of unicode character \U00010900

2021-09-05 Thread Max Bachmann
Max Bachmann added the comment: > That is using Python 3.9 in the xfce4-terminal. Which xterm are you using? This was in the default gnome terminal that is pre-installed on Fedora 34 and on windows I directly opened the Python Terminal. I just installed xfce4-terminal on my Fedora 34 mach

[issue45105] Incorrect handling of unicode character \U00010900

2021-09-05 Thread Max Bachmann
Max Bachmann added the comment: This is the result of copy pasting example posted above on windows using ``` Python 3.7.8 (tags/v3.7.8:4b47a5b6ba, Jun 28 2020, 08:53:46) [MSC v.1916 64 bit (AMD64)] on win32 ``` which appears to run into similar problems: ``` >>> s

[issue45105] Incorrect handling of unicode character \U00010900

2021-09-05 Thread Max Bachmann
New submission from Max Bachmann : I noticed that when using the Unicode character \U00010900 when inserting the character as character: Here is the result on the Python console both for 3.6 and 3.9: ``` >>> s = '0ऀ00' >>> s '0ऀ00' >>> ls = list(s) >>> ls ['0

[issue43565] PyUnicode_KIND macro does not has specified return type

2021-03-19 Thread Max Bachmann
New submission from Max Bachmann : The documentation stated, that the PyUnicode_KIND macro has the following interface: - int PyUnicode_KIND(PyObject *o) However it actually returns a value of the underlying type of the PyUnicode_Kind enum. This could be e.g. an unsigned int as well

[issue42629] PyObject_Call not behaving as documented

2020-12-12 Thread Max Bachmann
New submission from Max Bachmann : The documentation of PyObject_Call here: https://docs.python.org/3/c-api/call.html#c.PyObject_Call states, that it is the equivalent of the Python expression: callable(*args, **kwargs). so I would expect: PyObject* args = PyTuple_New(0); PyObject* kwargs