[issue42902] a python embedded program may load "C:\Lib\os.py" on windows system

2021-01-11 Thread houjingyi
New submission from houjingyi : environment: windows 10, python3.8.7 installed to "C:\Program Files\Python38". datail info: According to https://docs.python.org/3/c-api/init.html: "Py_SetPath() set the default module search path. If this function is called before Py_Initialize(), then Py_GetPa

[issue27820] Possible bug in smtplib when initial_response_ok=False

2021-01-11 Thread Pandu E POLUAN
Change by Pandu E POLUAN : -- components: +Tests ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue42903] optimize lru_cache for functions with no arguments

2021-01-11 Thread Eugene Toder
New submission from Eugene Toder : It's convenient to use @lru_cache on functions with no arguments to delay doing some work until the first time it is needed. Since @lru_cache is implemented in C, it is already faster than manually caching in a closure variable. However, it can be made even

[issue42901] [Enum] move member creation to __set_name__ in order to support __init_subclass__

2021-01-11 Thread Ethan Furman
Change by Ethan Furman : -- keywords: +patch pull_requests: +23022 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/24196 ___ Python tracker

[issue41116] build on macOS 11 (beta) does not find system-supplied third-party libraries

2021-01-11 Thread Dustin Rodrigues
Dustin Rodrigues added the comment: If your 'brew --prefix' is /opt/homebrew, then setting CFLAGS="-I/opt/homebrew/include" CPPFLAGS="-I/opt/homebrew/include" LDFLAGS="-L/opt/homebrew/lib" when running ./configure appears to be sufficient to build the interpreter with lzma support once you'

[issue42903] optimize lru_cache for functions with no arguments

2021-01-11 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch nosy: +python-dev nosy_count: 3.0 -> 4.0 pull_requests: +23023 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24197 ___ Python tracker _

[issue42904] get_type_hints does not provide localns for classes

2021-01-11 Thread Paul Bryan
New submission from Paul Bryan : According to PEP 563: > The get_type_hints() function automatically resolves the correct value of > globalns for functions and classes. It also automatically provides the > correct localns for classes. This statement about providing correct localns for classe

[issue42904] get_type_hints does not provide localns for classes

2021-01-11 Thread Paul Bryan
Change by Paul Bryan : -- nosy: +larry ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.or

[issue41868] SMTPLIB integrate or provide option to use "logging"

2021-01-11 Thread Pandu E POLUAN
Pandu E POLUAN added the comment: Will patching smtplib.SMTP._print_debug do? You can subclass from smtplib.SMTP this way: class MySMTPClient(smtplib.SMTP): def __init__(self, *args, logger=None, **kwargs): super().__init__(*args, **kwargs) self.logger = logger def _pr

[issue42904] get_type_hints does not provide localns for classes

2021-01-11 Thread Guido van Rossum
Guido van Rossum added the comment: Fidget-Spinner, are you interested in taking this? -- ___ Python tracker ___ ___ Python-bugs-li

[issue42904] get_type_hints does not provide localns for classes

2021-01-11 Thread Guido van Rossum
Guido van Rossum added the comment: It's apparently a bug in all versions that support `from __future__ import annotations` (and only when that is used). Though perhaps we should only fix in in 3.10. -- ___ Python tracker

[issue42895] Return multi-line list concatenation without parentheses returns only first operand

2021-01-11 Thread JD-Veiga
JD-Veiga added the comment: What a shame. I forget that + is also a unary operator. That produces a new logical line with correct identation though never executed. Sorry for the inconvenience.⁶ -- ___ Python tracker

[issue42888] Not installed “libgcc_s.so.1” causes parser crash.

2021-01-11 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: I've encountered this issue too. My use case was a 32-bit Python on a 64-bit CentOS system, and my understanding of the issue was that 64-bit libgcc_s is somehow counted as a "provider" of libgcc_s for 32-bit libc by the package manager, so 32-bit libgcc_s

[issue42903] optimize lru_cache for functions with no arguments

2021-01-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: Just use the new @cache decorator.¹ It's cleaner looking in code and already sets maxsize to None, making it perfect for your application. With respect to the proposed optimization, I'm sorry but further optimization of this already fast special case isn'

[issue42862] Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module

2021-01-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 This seems reasonable to me. -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-li

[issue42903] optimize lru_cache for functions with no arguments

2021-01-11 Thread Eugene Toder
Eugene Toder added the comment: As you can see in my original post, the difference between @cache (aka @lru_cache(None)) and just @lru_cache() is negligible in this case. The optimization in this PR makes a much bigger difference. At the expense of some lines of code, that's true. Also, fun

[issue42903] optimize lru_cache for functions with no arguments

2021-01-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: Some other thoughts: * A zero argument function that returns a constant is unlikely to ever be used in a tight loop. That would be pointless. * The @cache decorator is already 30% faster than calling an empty function. It's very cheap. * We really don't

[issue42903] optimize lru_cache for functions with no arguments

2021-01-11 Thread Ammar Askar
Ammar Askar added the comment: Additional discussion on the same topic on discourse: https://discuss.python.org/t/reduce-the-overhead-of-functools-lru-cache-for-functions-with-no-parameters/3956 -- nosy: +ammar2 ___ Python tracker

[issue42903] optimize lru_cache for functions with no arguments

2021-01-11 Thread Eugene Toder
Eugene Toder added the comment: Ammar, thank you for the link. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue42902] a python embedded program may load "C:\Lib\os.py" on windows system

2021-01-11 Thread Christian Heimes
Change by Christian Heimes : -- components: +Interpreter Core, Windows -C API nosy: +paul.moore, steve.dower, tim.golden, vstinner, zach.ware type: behavior -> security ___ Python tracker

[issue42902] a python embedded program may load "C:\Lib\os.py" on windows system

2021-01-11 Thread Christian Heimes
Change by Christian Heimes : -- nosy: +christian.heimes ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https

[issue42903] optimize lru_cache for functions with no arguments

2021-01-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: FYI: The @cache decorator was added as a result of that discussion and the related on python-ideas. -- ___ Python tracker ___ ___

[issue42905] Issue while installing numba

2021-01-11 Thread Sachit Murarka
New submission from Sachit Murarka : I am having Python 3.8 I am installing fastparquet. It is giving following error. I am doing it in Centos running build_ext building 'numba._dynfunc' extension Warning: Can't read registry to find the necessary compiler setting Make sure that Python

[issue42905] Issue while installing numba inside fastparquet

2021-01-11 Thread Sachit Murarka
Change by Sachit Murarka : -- title: Issue while installing numba -> Issue while installing numba inside fastparquet ___ Python tracker ___ ___

<    1   2