A side benefit is that if an Exception somehow propagates up where only
ExceptionGroup is defined, except *() could just work anyway, though it
might take a little magic to make sure they act the same. Like Guido said,
I don't think it can be retrofitted into existing *-less APIs, and it'll
either
After reading through the PEP and skimming the code (but I didn't build
it), something I didn't see: What happens to a currently conforming except
check?
try:
async with trio.open_nursery() as nursery:
# Make two concurrent calls to child()
nursery.start_soon(child)
On Tue, Feb 23, 2021 at 4:51 PM Random832 wrote:
> Why is it that this community is resigned to recommending a workaround
> when distributions decide the site-packages directory belongs to their
> package manager rather than pip, instead of bringing the same amount of
> fiery condemnation of
On Sun, Feb 21, 2021 at 10:02 AM Dan Stromberg wrote:
>
> It looks like CPython remains 100% C, so clang becomes more attractive:
>
> https://stackoverflow.com/questions/6329688/llvm-and-visual-studio-obj-binary-incompatibility
>
> Then again, do we allow C++ extension modules? That might make
On Mon, Feb 15, 2021 at 4:11 PM Victor Stinner wrote:
>
> I didn't use Ruby on Rails, but the feedback that I heard is that the
> ability to extend built-in types is appealing, but it is problematic
> in practice.
>
Monkeypatching's such a part of the Ruby (and Javascript) culture that
there
FWIW, it would really be nice if this was called IsInstance[...]; I feel
like that would neatly encapsulate its meaning to both old and new, that
it's just a yes/no on whether this is an instance of [...]. TypeScript has
the concept of a type guard but doesn't use that name in code, so there's
no
A call for standardization is typically done when multiple competing
de-facto standards competing for space, especially if it's relatively
immature, as a way to bring stakeholders together and reduce fragmentation.
You don't just go through the standards process for its own sake, unless
it's a
On Tue, Feb 2, 2021 at 3:47 AM Inada Naoki wrote:
> But when wchar_t* is UTF-16, ucs2_utf8_encoder() can not handle
> surrogate escape.
> We need to use a temporary Unicode object. That is what "inefficient"
> means.
>
Since real UCS-2 is effectively dead, maybe it should be flipped around:
On Thu, Jan 28, 2021 at 1:31 PM MRAB wrote:
> I have Microsoft Visual Studio Community 2019 Version 16.8.4 (it's free)
> and it supports C11 and C17.
While an upgrade for Community is free, for Pro/Enterprise without an
annual license it's not. They've gone 100% subscription now, but people
Even if you define __bool__() as returning a bool, and error/undefined
behavior otherwise, that doesn't eliminate side effects. Is it even
possible to nail down a definition to the point that you can say, "Thou
shalt not mutate or cause anything" and have it meaningfully enforced in
the compiler
Even if Python itself is the standard distribution, you should be able to
debug your outside DLL module in VS just by putting a breakpoint on your
favorite line and setting "/path/to/python.exe -m yourmodule" as the
command path under debugging in your project properties, or whatever
commandline
On Wed, Oct 28, 2020 at 6:49 AM Jean Abou Samra wrote:
> where `impossible` raises AssertionError.
>
Reserving a common English word as a new keyword (whether fail or
impossible) is the mother of all breaking changes. The syntactic sugar it
provides is not only tiny, it's pretty much negative,
On Mon, Sep 28, 2020 at 7:23 AM Marco Sulla
wrote:
> On Mon, 28 Sep 2020 at 13:56, Nick Coghlan wrote:
> > For usage, whether something is a macro or not should either be
> irrelevant (when they're used as a more powerful function call or
> > decorator), or else entirely obvious from the way
NotImplemented is like a pure virtual function; failing to implement it
tells you that you forgot part of the contract, except at runtime instead
of compile time. So if you never need them, you're free to elide them, but
if you want full compatibility, you need to implement every part of it.
If
On Sat, Sep 5, 2020 at 12:37 AM Ivan Pozdeev via Python-Dev <
python-dev@python.org> wrote:
> As I wrote in
> https://stackoverflow.com/questions/25337706/setuptools-vs-distutils-why-is-distutils-still-a-thing/40176290#40176290,
>
> distutils has a responsibility that setuptools as a 3rd-party
On Fri, Sep 4, 2020 at 3:11 PM Stefan Krah wrote:
>
>
> It is not hyperbolic at all. You can get permissions for a certain set
> of modules (the stdlib), but not for PyPI packages.
>
> Of course the upgrade is not via the network, that is beside the point.
>
If you can update to a breaking
On Fri, Sep 4, 2020 at 10:31 AM Stefan Krah wrote:
>
> All the time, especially when I'm writing them. I imagine that there's
> a huge amount of internal company code that discourages use of pip
> installed packages as well. Or has an air-gapped network in the first
> place.
>
That's wildly
On Sat, Jul 18, 2020 at 3:29 AM wrote:
> > adept at ignoring them, we will again have difficulties when debugging
> > as we won't easily see them.
> > Besides which, the problem is solved:
> >
> > namespace.var is a lookup
> > var is a store
>
> These rules can't be deduced from a few examples,
On Wed, Jul 8, 2020 at 7:03 AM Kerwin Sun wrote:
> I tried with this code:
>
[...]
> def whereis(point):
> case w:
> print("Not the answer, local w")
> case z:
> print("The answer")
> case _:
> print("other")
> whereis(42)
w, z
On Tue, Jul 7, 2020 at 8:37 AM Rhodri James wrote:
> I'm not quite convinced about making "_" non-binding, mostly because of
> the knock-on effects in the PEP for other types of patterns. It seems
> to breed more special cases, and I can't help but feel that's a bad sign.
>
After spending some
On Sat, Jul 4, 2020 at 5:37 PM Greg Ewing
wrote:
> On 5/07/20 3:24 am, Stephen J. Turnbull wrote:
> > Amusingly, Strunk (1918) was perfectly happy with split infinitives,
> > though he noted it centered whiteness. (Obviously he didn't put it
> > that way, more along the lines of "some people
I don't see how this extrapolates to arbitrary, extended match
expressions? You're proposing a slightly more flexible switch, which match
is only intended to be as the most basic case. Even if you purely swapped
it out with any the various proposals for identifying a constant vs a
target, it's
On Wed, Jul 1, 2020 at 4:09 AM Antoine Pitrou wrote:
> How does this help third-party extensions?
>
If the cost is high enough, exposing the guts of a function to allow the
compiler to inline it is not unreasonable; all of the major compilers have
ways to inline things that are technically
I completely agree with this, that UTF-8 has become the One True
Encoding(tm), and UCS-2 and UTF-16 are hardly found anywhere outside of the
Win32 API. Nearly all basic emoji can't be represented in UCS-2 wchar_t,
let alone composite emoji.
So how to make that C-compatible? Make everything a
On Mon, Jun 29, 2020 at 7:41 PM Raymond Hettinger <
raymond.hettin...@gmail.com> wrote:
> Perhaps you don't want to believe the results, but the timings are
> careful, stable, repeatable, and backed-up by a disassembly that shows the
> exact cause. The builds used for the timings were the
On Fri, Jun 26, 2020 at 3:47 AM Paul Moore wrote:
> For me, this prompts the question (which I appreciate is more about
> implementation than design) - would there be any (significant)
> performance difference between [...]
> In C, the switch statement was explicitly intended to be faster by
>
On Fri, Jun 26, 2020 at 12:42 AM Rob Cliffe via Python-Dev <
python-dev@python.org> wrote:
> 1) In the beginning of the "Mapping Pattern" section:
> "{" (pattern ":" pattern)+ "}"
> This is spelt inconsistently: there is a `+` before the closing `}`
> but not after the opening
Whoops, meant to reply to Gregory on that one, sorry Richard.
On Thu, Jun 25, 2020 at 7:15 PM Gregory P. Smith wrote:
>
> Can I use an i18n'd _("string") within a case without jumping through
> hoops to assign it to a name before the match:?
>
The PEP currently says:
>
> "The named class
On Thu, Jun 25, 2020 at 8:31 PM Richard Damon
wrote:
>
> I thought _ was also commonly used as:
>
> first, -, last = (1, 2, 3)
>
> as a generic don't care about assignment. I guess since the above will
> create a local, so not overwrite a 'global' function _ for translations,
> so the above
On Thu, Jun 25, 2020 at 3:41 PM Richard Damon
wrote:
> Actually, you could make _ less special by still binding the value to
> it, just make it special in that you allow several values to be bound,
> and maybe just define that the result will be just one of the values,
> maybe even specify which
On Wed, Jun 24, 2020 at 12:46 PM Guido van Rossum wrote:
> Everyone,
>
> If you've commented and you're worried you haven't been heard, please add
> your issue *concisely* to this new thread. Note that the following issues
> are already open and will be responded to separately; please don't
On Thu, Jun 25, 2020 at 9:21 AM Rhodri James wrote:
> Well, now is the time for expressing surprise :-p
>
> As I've said before, one of my main problems with the PEP is as you go
> through it, more and more special cases and surprises appear, and the
> consequences of earlier surprises generate
On Wed, Jun 24, 2020 at 3:15 PM Ethan Furman wrote:
> > I too thought "why not else:?" at first. But "case _:" covers it in
> > the one obvious way after grasping how general wildcard matches are.
>
> "case _:" is easy to miss -- I missed it several times reading through the
> PEP.
>
> >
On Tue, Jun 23, 2020 at 10:59 PM Rob Cliffe via Python-Dev <
python-dev@python.org> wrote:
>
> >> I also (with others) prefer `else:` or perhaps `case else:` to using
> >> the`_` variable.
> >> The latter is obscure, and woudn't sit well with code that already
> >> uses that variable for its own
On Tue, Jun 23, 2020 at 2:10 PM MRAB wrote:
> I think that's done for consistency. '_' is a wildcard and you can have:
>
> case (_, _):
>
> to match any 2-tuple, so:
>
> case _:
>
> would match any value, and can thus already serve as the default.
>
> I wouldn't object to 'else',
It's still a problem, even if it's a problem in the opposite direction than
you first thought (Python has a newer sqlite, rather than older). Updating
your API fixes the problem now, but you still need to decide how you check
for and handle newer, potentially incompatible library versions.
On
On Wed, Jun 17, 2020 at 5:56 AM Nick Coghlan wrote:
>
> Doing full blown zero-copy ownership transfer of actual Python objects
> would be more difficult, since the current plan is to have separate memory
> allocation pools per interpreter to avoid excessive locking overhead, so I
> don't
Isn't it more Pythonic to simply call the function and an alternative path
to handle the exception, anyway? Half of os needs to be tested for
NotImplementedError or OSError if it's going to run anywhere outside the
development environment anyway, otherwise you're stuck with only the most
basic
On Fri, Jun 12, 2020 at 7:19 AM Mark Shannon wrote:
> Hi Edwin,
>
> Thanks for providing some concrete numbers.
> Is it expected that creating 100 processes takes 6.3ms per process, but
> that creating 1000 process takes 40ms per process? That's over 6 times
> as long in the latter case.
>
>
On Wed, Jun 10, 2020 at 5:37 AM Mark Shannon wrote:
> By sharing an address space the separation is maintained by trust and
hoping that third party modules don't have too many bugs.
By definition, the use of any third-party module (or even the standard
library itself) is by trust and the hope
Python has always preferred full-word over old-school C/Perl/PHP-style
abbreviated names. Clarity is paramount. (Or this whole discussion wouldn't
even be happening.)
I think this is *more* of a zip_shortest than zip_strict, but since you can
never have total clarity without a method name that
On Wed, May 6, 2020 at 12:36 PM Nathaniel Smith wrote:
>
> Sure, zero cost is always better than some cost, I'm not denying that
> :-). What I'm trying to understand is whether the difference is
> meaningful enough to justify subinterpreters' increased complexity,
> fragility, and ecosystem
Main memory bus or cache contention? Integer execution ports full?
Throttling? VTune is useful to find out where the bottleneck is, things
like that tend to happen when you start loading every logical core.
On Tue, May 5, 2020 at 4:45 PM Joseph Jenne via Python-Dev <
python-dev@python.org>
Thanks, this is what I was looking for and couldn't find. I'm glad it is
something that's been considered and debated before. I'm not sure why I
couldn't find it or anything like it, but I guess the syntax is just a
needle in a haystack.
Em
On Sat, May 2, 2020 at 7:42 AM Henk-Jaap Wagenaar <
I hope this isn't too noobish, nothing on the list comes up in Google, but
I'm curious why the construct
for x in y if x.is_some_thing:
# do a thing
isn't legal. That seems a very Pythonic symmetry with lambdas. The
equivalent syntax required right now is,
for x in [x for x in y if
45 matches
Mail list logo