[Python-Dev] Summary of Python tracker Issues

2021-06-25 Thread Python tracker


ACTIVITY SUMMARY (2021-06-18 - 2021-06-25)
Python tracker at https://bugs.python.org/

To view or respond to any of the issues listed below, click on the issue.
Do NOT respond to this message.

Issues counts and deltas:
  open7410 (-36)
  closed 48834 (+91)
  total  56244 (+55)

Open issues with patches: 2951 


Issues opened (34)
==

#34389: CPython may fail to build in the presence of a ~/.pydistutils.
https://bugs.python.org/issue34389  reopened by iritkatriel

#43988: Add test.support.check_disallow_instantiation()
https://bugs.python.org/issue43988  reopened by erlendaasland

#44455: compileall should exit nonzero for nonexistent directories
https://bugs.python.org/issue44455  opened by asmeurer

#44457: Finish format() change started in issue43945
https://bugs.python.org/issue44457  opened by ethan.furman

#44461: 'Pdb' object has no attribute 'botframe'
https://bugs.python.org/issue44461  opened by jaraco

#44462: multiprocessing.get hangs if the pool is closed in the signal 
https://bugs.python.org/issue44462  opened by tkc17

#44463: HTTP Cookiejar doesn't support samesite
https://bugs.python.org/issue44463  opened by jwag956

#44464: Remove flake8 exception for deprecation warning (importlib.met
https://bugs.python.org/issue44464  opened by jaraco

#44465: html.escape can be used in a few places in the standard lib in
https://bugs.python.org/issue44465  opened by andrei.avk

#44467: profiling-compatible functools.wraps
https://bugs.python.org/issue44467  opened by Anthony Sottile

#44468: Shouldn't `typing.get_type_hints()` default `globalns` to `{}`
https://bugs.python.org/issue44468  opened by WCA

#44470: 3.11 docs.python.org in Polish not English?
https://bugs.python.org/issue44470  opened by samuelmarks

#44471: Raise TypeError in ExitStack.enter_context() for bad argument
https://bugs.python.org/issue44471  opened by serhiy.storchaka

#44473: logging.handlers.QueueHandler acts unexpected
https://bugs.python.org/issue44473  opened by kai.jmueller

#44474: inspect.getsourceslines() consider lambda of one line only
https://bugs.python.org/issue44474  opened by Welgriv

#44475: Dataclass Causes Infinite Recursion when using type of bytes
https://bugs.python.org/issue44475  opened by andrewonboe

#44479: Windows build doesn't regenerate some files
https://bugs.python.org/issue44479  opened by gvanrossum

#44480: test_compile killed by signal 9 on AMD64 FreeBSD Non-Debug 3.x
https://bugs.python.org/issue44480  opened by vstinner

#44481: Tkinter config() minor documentation bug for shorthand options
https://bugs.python.org/issue44481  opened by spirko

#44482: Possible resource leeak in glob in non-refcount implementation
https://bugs.python.org/issue44482  opened by serhiy.storchaka

#44484: test_concurrent_futures: failure on Windows (x64)
https://bugs.python.org/issue44484  opened by erlendaasland

#44489: _handle_existing_loggers should respect loggers that were manu
https://bugs.python.org/issue44489  opened by ronserruya2

#44490: PEP 604 Union (int | str) doesn't have __parameters__
https://bugs.python.org/issue44490  opened by kj

#44492: Building a C extension on Big Sur and SDK v10.15 fails
https://bugs.python.org/issue44492  opened by philthompson10

#44493: Missing terminated NUL in the length of sockaddr_un
https://bugs.python.org/issue44493  opened by zonyitoo

#44495: wrong FNAME in tarfile if tgz extension is used
https://bugs.python.org/issue44495  opened by maciej.mm.misiak

#44496: string.Formatter class not allowing {.field}
https://bugs.python.org/issue44496  opened by avdwoude

#44498: add deprecation warnings for asynchat, asyncore and smtpd
https://bugs.python.org/issue44498  opened by iritkatriel

#44499: [sqlite3] make sqlite3.Connection exception refs strong
https://bugs.python.org/issue44499  opened by erlendaasland

#44500: Document changes to code object.
https://bugs.python.org/issue44500  opened by Mark.Shannon

#44501: Packing constant call arguments
https://bugs.python.org/issue44501  opened by BTaskaya

#44503: Hide __enter__ calls in mock_open
https://bugs.python.org/issue44503  opened by CendioOssman

#44504: Make docstring quotes consistent in Lib/_collections_abc.py
https://bugs.python.org/issue44504  opened by kuzmovych

#44508: asyncio: document failure mode for loop.call_soon_threadsafe
https://bugs.python.org/issue44508  opened by mark.dickinson



Most recent 15 issues with no replies (15)
==

#44508: asyncio: document failure mode for loop.call_soon_threadsafe
https://bugs.python.org/issue44508

#44504: Make docstring quotes consistent in Lib/_collections_abc.py
https://bugs.python.org/issue44504

#44500: Document changes to code object.
https://bugs.python.org/issue44500

#44499: [sqlite3] make sqlite3.Connection exception refs strong
https://bugs.python.org/issue44499

#44496: string.Formatter class not allowing {.field}
https://bugs.python.org/issue44496

#44495: wrong FNAME in tarfile 

[Python-Dev] Re: Delayed evaluation of f-strings?

2021-06-25 Thread Eric Nieuwland

> On 24 Jun 2021, at 10:28, micro codery  wrote:
> 
> As pointed out already, f-strings and format are subtly different (not
> counting that one can eval and the other cannot). Besides quoting, the
> f-sting mini language has diverged from format's
 spam="Spam"
 f"{spam=}"
> "spam='Spam'"
 "{spam=}".format(spam=spam)
> Traceback (most recent call last):
>  File "", line 1, in 
> KeyError: 'spam='
> 
> I created a package some time ago to do exactly this
> https://pypi.org/project/f-yeah/

Lovely! Thanks.

—eric
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/RIWZ6ABBMQXB32QVUCJU43QZM3HNZ74R/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Delayed evaluation of f-strings?

2021-06-25 Thread Eric V. Smith

On 6/24/2021 11:28 PM, Guido van Rossum wrote:
On Thu, Jun 24, 2021 at 10:34 AM micro codery > wrote:


As pointed out already, f-strings and format are subtly different
(not counting that one can eval and the other cannot). Besides
quoting, the f-sting mini language has diverged from format's
>>> spam="Spam"
>>> f"{spam=}"
"spam='Spam'"
>>> "{spam=}".format(spam=spam)
Traceback (most recent call last):
  File "", line 1, in 
KeyError: 'spam='


Eric, what would you think of adding this feature to format()? It 
seems doable (at least for keyword args -- for positional args I don't 
think it makes sense).


The only problem is that it already has a meaning, as unlikely as it is 
that someone would use it:


>>> d = {'x = ': 42}
>>> "{x = }".format(**d)
'42'

Plus there's the issue of whitespace being treated differently with 
f-strings and str.format().




Honestly, the rest of the discussion belongs on python-ideas.


I totally agree.

Eric

___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/BVXP4MC7GCI6QWUQ7HHZC3KFV4RXYTIK/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Delayed evaluation of f-strings?

2021-06-25 Thread Serhiy Storchaka
24.06.21 12:37, Eric Nieuwland пише:
> In a recent discussion with a colleague we wondered if it would be
> possible to postpone the evaluation of an f-string so we could use it
> like a regular string and .format() or ‘%’.

You can just use lambda:

delayed_fstring = lambda: f"The current name is {name}"
print(delayed_fstring())

If you want to get rid of () when convert to string, you can use a wrapper:

class LazyStr:
def __init__(self, str_func):
self._str_func = str_func
def __str__(self):
return self._str_func()

delayed_fstring = LazyStr(lambda: f"The current name is {name}")
print(delayed_fstring)

but it works only if str() is directly or indirectly called for the
value. You cannot pass it open() as a file name, because open() expects
only str, bytes, integer of path-like object. Most builtin functions
will not and could not work with LazyStr.

As for evaluating variables in different scope as in your example, it
just does not work in Python. Python uses static binding, not dynamic
binding. First than introducing "delayed f-strings" you need to
introduce dynamic binding in normal functions.

___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/IG6HEHUXY3K4WJ2PYIG47II7ESOIAQIK/
Code of Conduct: http://python.org/psf/codeofconduct/