Seems nice. Just write a library and upload it to one of the usual places?
On Thu, 31 Aug 2023, 16:54 Tim Hoffmann via Python-ideas, <
python-ideas@python.org> wrote:
> The standard pattern to create a sentinel in Python is
>
> >>> Unset = object()
>
> While this is often good enough, it has
This is sometimes a nice function to have. For example, Haskell has a
similar function:
https://hackage.haskell.org/package/base-4.18.0.0/docs/Data-List.html#v:intercalate
that I use in real code every once in a while.
But I don't think you need to stick this function in the standard library.
A
hat if it's done not by format method but by a separete method, say,
> format_partially or something? The method is different from format
> also in that it should leave "{{" and "}}" unaltered.
>
> On Fri, 28 Apr 2023 at 00:05, Matthias Görgens
> wrote:
&g
What is the use case for this?
Does it have any use case that's not already served by functools.partial?
As far as I can tell, this proposal would turn buggy code that currently
throws an obvious exception into code that silently does the wrong thing.
This seems more appropriate for PHP or
What's the use-case for this?
Have you looked into using functools.partial instead?
On Sat, 22 Apr 2023, 06:23 Samuel Muldoon, wrote:
> Consider the following string:
>
> x = r"\mathjax{{color}}{{text}}"
>
> string `x` contains two parameters named `color` and the other named `text
> `.
>
>
On Tue, 15 Nov 2022 at 00:14, David Mertz, Ph.D.
wrote:
> In general, all PRNGs are deterministic, and by relying on a known seed,
> the Nth element in a sequence of random numbers can always be
> reconstructructed. However, if a large number of random numbers are used,
> certain replication
Btw, just to give some context:
The reason we need sentinels at all is because our APIs don't like to wrap
the happy case.
As an example:
So in Python, when you do {'a': 'foo'}.get('a') you get 'foo' directly.
That's convenient.
In eg Haskell the equivalent operation gives you a wrapped 'foo'.
>
> It depends on context whether it makes sense to define a custom exception,
> and I agree that I frequently should define a custom exception. In that
> case though, it would still be nice to have an appropriate generic
> exception for that to inherit from, just as I would inherit from
>
>
> If the target of the call isn't in an appropriate state, isn't that a
> bug in the constructor that it allows you to construct objects that are
> in an invalid state?
>
> You should fix the object so that it is never in an invalid state rather
> than blaming the caller.
>
You can't really do
Hi Brian,
It sounds like a high quality third-party library that has both a multiset
implementation and the itertools you needed would fulfill most of your
requirements?
Code in the standard library isn't magically of higher quality. Compare eg
standard library dataclasses with dataclassy.
As a
10 matches
Mail list logo