[issue41383] Provide a limit arguments for __repr__
New submission from Bernat Gabor : Quoting Elizaveta Shashkova from EuroPython 2020 chat about how can we improve debug experience for users: I would like to have a lazy repr evaluation for the objects! Sometimes users have many really large objects, and when debugger is trying to show them in Variables View (=show their string representation) it can takes a lot of time. We do some tricks, but they not always work. It would be really-really cool to have parameter in repr, which defines max number of symbols we want to evaluate during repr for this object. What do people, would this optional str limit be a good thing? Does anyone has a better idea? -- components: Interpreter Core messages: 374179 nosy: Bernat Gabor priority: normal severity: normal status: open title: Provide a limit arguments for __repr__ versions: Python 3.10 ___ Python tracker <https://bugs.python.org/issue41383> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41383] Provide a limit arguments for __repr__
Bernat Gabor added the comment: Thanks Rémi, did not know about it. Played around with it, and is not entirely what we'd need here. That class still generates the long string repr, just truncates it afterwards. That is unless teh Repr implements custom formatting for the types, however the Repr would be the IDEs code, and that doesn't understand enough the user code to be able to tell what's a good short representation for it. This was the idea with adding it as a parameter to the repr function, that the user can customize/override the outcome depenending how many characters it has left to use up for repr. -- ___ Python tracker <https://bugs.python.org/issue41383> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41523] functools.cached_property does not satisfy the property check
New submission from Bernat Gabor : from functools import cached_property, lru_cache class A: @property def a(self): return '' @cached_property def b(self): return '' @property @lru_cache def c(self): return "" print(isinstance(A.a, property)) print(isinstance(A.b, property)) print(isinstance(A.c, property)) True False True I feel like cached property should be of type property, not? -- messages: 375188 nosy: Bernat Gabor priority: normal severity: normal status: open title: functools.cached_property does not satisfy the property check versions: Python 3.10, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue41523> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41523] functools.cached_property does not satisfy the property check
Bernat Gabor added the comment: I understand under the hood they're differenet, however I think cached_property wanted to be a shorter/better version of @property@lru_cache which does passes this check. Tools expecting properties to pass that check now need to extend their check... and similarly now is no longer enough to use isinstance property to check if something is a property. -- ___ Python tracker <https://bugs.python.org/issue41523> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41619] Subprocesses created with DETACHED_PROCESS can pop up a console window
Change by Bernat Gabor : -- nosy: +Bernat Gabor ___ Python tracker <https://bugs.python.org/issue41619> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41973] Docs: TypedDict is now of type function instead of class
New submission from Bernat Gabor : ❯ py -3.8 -c 'from typing import TypedDict; print(type(TypedDict))' ❯ py -3.9 -c 'from typing import TypedDict; print(type(TypedDict))' Python 3.9 changed the type of the TypedDict but the documentation still says it's a class - see https://docs.python.org/3.9/library/typing.html#typing.TypedDict. I must also say I'm suprised you can inherit from a function, but we should update the documentation to reflect that the type of the element in question is no longer class. -- messages: 378212 nosy: gaborjbernat priority: normal severity: normal status: open title: Docs: TypedDict is now of type function instead of class versions: Python 3.10, Python 3.9 ___ Python tracker <https://bugs.python.org/issue41973> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41973] Docs: TypedDict is now of type function instead of class
Bernat Gabor added the comment: Static checkers/linters (see e.g. https://github.com/PyCQA/pylint/issues/3884) are caught of guard by being able to inherit from functions. They'll need to adapt, but let's update the documentation to reflect this. -- ___ Python tracker <https://bugs.python.org/issue41973> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41973] Docs: TypedDict is now of type function instead of class
Bernat Gabor added the comment: This seem to apply to typing.NamedTuple too. -- ___ Python tracker <https://bugs.python.org/issue41973> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42013] venv on Windows with symlinks is broken if invoked with -I
New submission from Bernat Gabor : Here's a small reproducible, run it on a Windows OS that has symlinks enabled: import shutil import venv import subprocess shutil.rmtree("venv", ignore_errors=True) venv.EnvBuilder(with_pip=False, symlinks=True).create("venv") # works subprocess.check_call(["venv\\Scripts\\python.exe", "-c", "import sys; print(sys.executable)"]) # fails with No module named 'encodings' subprocess.check_call(["venv\\Scripts\\python.exe", "-Ic", "import sys; print(sys.executable)"]) -- messages: 378485 nosy: gaborjbernat priority: normal severity: normal status: open title: venv on Windows with symlinks is broken if invoked with -I versions: Python 3.10, Python 3.9 ___ Python tracker <https://bugs.python.org/issue42013> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42013] venv on Windows with symlinks is broken if invoked with -I
Change by Bernat Gabor : -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker <https://bugs.python.org/issue42013> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42013] venv on Windows with symlinks is broken if invoked with -I
Bernat Gabor added the comment: ❯ py -c 'import sys; print(sys.version)' 3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)] -- ___ Python tracker <https://bugs.python.org/issue42013> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42013] venv on Windows with symlinks is broken if invoked with -I
Bernat Gabor added the comment: Ok, the missing link is that the python you run into needs to be also a symlink venv: ❯ py -m venv env --without-pip --clear --symlinks ❯ .\env\Scripts\python.exe -c "import venv, subprocess; venv.EnvBuilder(with_pip=False, symlinks=True).create('venv'); subprocess.check_call(['venv\\Scripts\\python.exe', '-Ic', 'import sys; print(sys.executable)'])" Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding Python runtime state: core initialized ModuleNotFoundError: No module named 'encodings' -- nosy: -FFY00 ___ Python tracker <https://bugs.python.org/issue42013> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42013] venv on Windows with symlinks is broken if invoked with -I
Bernat Gabor added the comment: > We need more information about the specific environment this is triggering. Both Gitub Actions Windows CPython3.9 or installer as downloaded from (on Windows 10) https://www.python.org/downloads/release/python-390/. > PYTHONHOME should not be set all. PYTHONPATH needs to be set carefully. It > should never include standard-library path The issue manifests independent of those environment variables, netiher of them are set. -- ___ Python tracker <https://bugs.python.org/issue42013> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42041] venv subprocess call to python resolves to wrong interpreter
Bernat Gabor added the comment: I wonder if this is an interaction issue with the builtin Windows provided python executable? -- nosy: +eryksun, gaborjbernat ___ Python tracker <https://bugs.python.org/issue42041> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42041] venv subprocess call to python resolves to wrong interpreter
Bernat Gabor added the comment: Taking a look at the existing documentation this should probably be mentioned under the args part of https://docs.python.org/3/library/subprocess.html#popen-constructor, not? (that's where other similar gotchas are explained too) -- ___ Python tracker <https://bugs.python.org/issue42041> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com