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

2021-06-24 Thread Martin (gzlist) via Python-Dev
On Thu, 24 Jun 2021 at 17:37, Martin (gzlist) wrote: > > >>> d = dict(a=1) > >>> f'{d["a"]}' > '1' > >>> str(DelayedFString('{d["a"]}')) > Traceback (most recent call last): > File "", line 1

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

2021-06-24 Thread Martin (gzlist) via Python-Dev
On Thu, 24 Jun 2021 at 17:25, Eric Nieuwland wrote: > > class DelayedFString(str): > def __str__(self): > vars = inspect.currentframe().f_back.f_globals.copy() > vars.update(inspect.currentframe().f_back.f_locals) > return self.format(**vars) This isn't quite right as

[Python-Dev] Re: On the migration from master to main

2021-05-10 Thread Martin (gzlist) via Python-Dev
On Tue, 23 Mar 2021 at 21:39, Python Steering Council wrote: > > This isn’t happening because GitHub/Microsoft made a political decision. It’s > happening because it is incredibly easy to make this move, many projects have > already done this, and it reflects badly on any project not making

[Python-Dev] Re: Integer concatenation to byte string

2021-03-05 Thread Martin (gzlist) via Python-Dev
On Tue, 2 Mar 2021 at 21:44, Memz wrote: > > foo+= 255 # Works the same as > bytesvariable+=b"ÿ" foo = b"%b%d" % (foo, 255) > foo+= a"\x255\x00" # Concatenation with itself foo = b"%b%b" % (foo, foo) See PEP461: Adding % formatting to bytes

[Python-Dev] Re: PEP 638: Syntactic macros

2020-10-19 Thread Martin (gzlist) via Python-Dev
On Fri, 16 Oct 2020 at 23:22, Guido van Rossum wrote: > > Dima, > > Do you have a link to "babel macros"? Searching for that brought up several > different things; not being a frequent JS user I don't know how to filter > these. These links should help:

[Python-Dev] Re: Something wrong with the bug tracker?

2019-12-22 Thread Martin (gzlist) via Python-Dev
Logging in with openid using launchpad just worked for me, so transient or related to google's openid support presumably. Martin On Sun, 22 Dec 2019 at 15:13, Mark Shannon wrote: > > Hi, > > For some reason I can't log into the bug tracker with Google. > I just get the error message: > > """ >

Re: [Python-Dev] Replacement for array.array('u')?

2019-03-25 Thread Martin (gzlist) via Python-Dev
On Fri, 22 Mar 2019 at 16:12, Steve Dower wrote: > > On 22Mar2019 0433, Antoine Pitrou wrote: > > The question is: why would you use a array.array() with a Windows C API? > > I started replying to this with a whole lot of examples, and eventually > convinced myself that you wouldn't (or

Re: [Python-Dev] Evil reference cycles caused Exception.__traceback__

2017-09-18 Thread Martin (gzlist) via Python-Dev
Thanks for working on this and writing up the details Victor. For those confused about why this matters, routinely having every object in your application participating in one (or more) giant reference cycles makes reasoning about and fixing resource issues very difficult. For instance, a while

Re: [Python-Dev] PEP 538 (review round 2): Coercing the legacy C locale to a UTF-8 based locale

2017-06-12 Thread Martin (gzlist) via Python-Dev
Thanks for replying to my points! On 12/06/2017, Nick Coghlan wrote: > > `PYTHONIOENCODING=:strict` remains the preferred way of forcing strict > encoding checks on the standard streams, regardless of locale. Then the user of my script has to care that it's written in Python

Re: [Python-Dev] Handle errors in cleanup code

2017-06-12 Thread Martin (gzlist) via Python-Dev
On 12/06/2017, Serhiy Storchaka wrote: > > But if an error is raised when execute undo_something(), it replaces the > original exception which become chaining as the __context__ attribute. > The problem is that this can change the type of the exception. If >

Re: [Python-Dev] PEP 538 (review round 2): Coercing the legacy C locale to a UTF-8 based locale

2017-06-11 Thread Martin (gzlist) via Python-Dev
On 09/05/2017, Nick Coghlan wrote: > > Enough changes have accumulated in PEP 538 since the start of the > previous thread that it seems sensible to me to start a new thread > specifically covering the current design (which aims to address all > the concerns raised in the

Re: [Python-Dev] Deprecate codecs.open() and StreamWriter/StreamReader

2011-05-24 Thread Martin (gzlist)
On 24/05/2011, Victor Stinner victor.stin...@haypocalc.com wrote: In Python 2, codecs.open() is the best way to read and/or write files using Unicode. But in Python 3, open() is preferred with its fast io module. I would like to deprecate codecs.open() because it can be replaced by open() and

Re: [Python-Dev] Test cases not garbage collected after run

2011-04-15 Thread Martin (gzlist)
On 14/04/2011, Michael Foord fuzzy...@voidspace.org.uk wrote: I'd be interested to know what is keeping the tests alive even when the test suite isn't. As far as I know there is nothing else in unittest that would do that. The main cause is some handy code for collecting and filtering tests by

Re: [Python-Dev] Test cases not garbage collected after run

2011-04-13 Thread Martin (gzlist)
On 07/04/2011, Michael Foord fuzzy...@voidspace.org.uk wrote: On 07/04/2011 20:18, Robert Collins wrote: Testtools did something to address this problem, but I forget what it was offhand. Some issues were worked around, but I don't remember any comprehensive solution. The proposed fix is to

Re: [Python-Dev] Fault handler updated, now disabled by default

2010-12-23 Thread Martin (gzlist)
On 23/12/2010, Victor Stinner victor.stin...@haypocalc.com wrote: I tested my patch on Windows (XP), Ubuntu (10.4) and FreeBSD (8) and it works correctly: all tests pass and the system fault handler (Windows popup, Apport and core dump) is also called. Doesn't build for me without #ifdef

Re: [Python-Dev] Issue #8863 adds a new PYTHONNOFAULTHANDLER environment variable

2010-12-20 Thread Martin (gzlist)
On 20/12/2010, Michael Foord fuzzy...@voidspace.org.uk wrote: On 19/12/2010 23:02, Victor Stinner wrote: I don't think that kill() is available on Windows. Can just use raise instead. But, is any of this change valid on Windows? http://msdn.microsoft.com/library/xdkz3x12 The SIGILL, SIGSEGV,

Re: [Python-Dev] (Not) delaying the 3.2 release

2010-09-16 Thread Martin (gzlist)
On 16/09/2010, Guido van Rossum gu...@python.org wrote: In all cases I can imagine where such polymorphic functions make sense, the necessary and sufficient assumption should be that the encoding is a superset of 7-bit(*) ASCII. This includes UTF-8, all Latin-N variant, and AFAIK also the

Re: [Python-Dev] (Not) delaying the 3.2 release

2010-09-16 Thread Martin (gzlist)
On 16/09/2010, Guido van Rossum gu...@python.org wrote: On Thu, Sep 16, 2010 at 11:16 AM, Toshio Kuratomi a.bad...@gmail.com wrote: You were talking about encodings that were supersets of 7-bit ASCII. I think Martin was demonstrating a byte string that was a superset of 7-bit ASCII being fed

Re: [Python-Dev] Issue #7978, unexpected EINTR-related exceptions

2010-04-12 Thread Martin (gzlist)
On 08/04/2010, Victor Stinner victor.stin...@haypocalc.com wrote: Le jeudi 08 avril 2010 08:11:09, Yaniv Aknin a écrit : Issue #7978 (http://bugs.python.org/issue7978) describes a bug in SocketServer where a received signal in SocketServer's select() call will raise an uncaught exception due

Re: [Python-Dev] Question over splitting unittest into a package

2009-12-31 Thread Martin (gzlist)
Thanks for the quick response. On 30/12/2009, Benjamin Peterson benja...@python.org wrote: When I made that change, I didn't know that the __unittest hack was being used elsewhere outside of unittest, so I felt fine replacing it with another. While I still consider it an implementation

Re: [Python-Dev] Retrieve an arbitrary element from a set without removing it

2009-10-24 Thread Martin (gzlist)
On 24/10/2009, Nick Coghlan ncogh...@gmail.com wrote: Ben Finney wrote: Which then raises the question “what part of the set does it get?”, which the function signature does nothing to answer. I'm proposing that a no-parameters ‘set.get’ is needlessly confusing to think about. The fact that

Re: [Python-Dev] Mercurial migration: help needed

2009-09-05 Thread Martin (gzlist)
On 05/09/2009, Antoine Pitrou solip...@pitrou.net wrote: Terry Reedy tjreedy at udel.edu writes: If essentially all text files need fixed line endings on Windows, then hg really needs this built in. Has it really not been used much on Windows? Mercurial is used by e.g. Mozilla, which is not

Re: [Python-Dev] Mercurial migration: help needed

2009-09-05 Thread Martin (gzlist)
On 05/09/2009, Martin v. Löwis mar...@v.loewis.de wrote: Creating the clone. ISTM that it leaves the http connection open while doing stuff locally (or creates multiple of them, and one times out). It starts cloning, and then, after an hour or so, it reports ABORT, and rolls back, for no