Seems fine, but a pypi library seems better than the standard library.
Separately, I think this is usually called "currying", and there are
already libraries which implement this functionality, eg toolz:
https://toolz.readthedocs.io/en/latest/curry.html
Best wishes,
L
On Tue, Apr 4, 2023 at 7:19 AM Jonathan Crall wrote:
> Would there be any downside to the Python CLI automatically dedenting the
> input string given to -c? I can't think of any case off the top of my head
> where it would make a previously valid program invalid. Unless I'm missing
> something th
https://github.com/Snaipe/BoxFort)
Presumably web browsers like Chrome have some prior art as well.
Best wishes,
Lucas Wiman
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail
here:
https://github.com/python/cpython/blob/f4fcfdf8c593611f98b9358cc0c5604c15306465/Lib/unittest/mock.py#L1107
Does anyone see any problems with implementing this?
Thanks & best wishes,
Lucas Wiman
___
Python-ideas mailing list -- python
On Tue, Dec 20, 2022 at 5:38 PM Christopher Barker
wrote:
> But collections.UserString does exist -- so if you want to subclass, and
> performance isn't critical, then use that. Steven A pointed out that
> UserStrings are not instances of str though. I think THAT is a bug. And
> it's probably tha
that make
using regexes in match statements much easier: see
https://www.dropbox.com/s/w1bs8ckekki9ype/PyITPatternMatchingTalk.pdf?dl=0
and https://twitter.com/i/web/status/1533369943764488192
Best wishes,
Lucas Wiman
___
Python-ideas mailing list -- python-ideas@python.o
On Wed, Jul 27, 2022 at 1:07 PM Chris Angelico wrote:
> with all the variants of keyword and positional args. Being able to
> say "this function has the same signature as that one, plus it accepts
> consumed_arg" or "same, but without added_arg" would be extremely
> useful, and short of some fair
Михаил Крупенков:
> Yes, I want that when Void is received in a function parameter it is not
processed:
>
> func(Void) == func() == "default"
Mathew Elman:
> I believe this is a rebirth of a request that has come up many times
before, which is to have something like javascript's `undefined` where
Some background. PEP 3132 (https://peps.python.org/pep-3132/) lists the
following:
>
> Possible changes discussed were:
>
>
>- Only allow a starred expression as the last item in the exprlist.
>This would simplify the unpacking code a bit and allow for the starred
>expression to be assi
Since "today" depends on the time zone, it should be an optional argument
to date.today(). The interface should be the same as datetime.now(tz=None),
with date.today() returning the date in the system time zone.
Rationale: It is common for processes to run in different timezones than
the relevant
>
> "Self-explanatory". This is how we got Perl and APL o_O
What I mean is that if you already know the destructuring syntax, then it’s
pretty clear what it means. If you already know existing syntax, / isn’t
suggesting of anything. The only related syntax is for declaring
positional-only argumen
Using either * or / could lead to some odd inconsistencies where a missing
space is very consequential, eg:
x, / = foo # fine
x, /= foo # syntax error?
x / = foo # syntax error
x /= foo # fine, but totally different from the first example.
That said, the * syntax feels intuitive in a way that
s like a reasonable addition.
Best wishes,
Lucas Wiman
On Fri, Jun 17, 2022 at 1:12 PM Jonathan Slenders
wrote:
> Hi everyone,
>
> Today was the 3rd time I came across a situation where it was needed to
> retrieve all the positions of the line endings (or beginnings) in a very
> lo
On Fri, Mar 9, 2018 at 6:24 PM, MRAB wrote:
> On 2018-03-10 01:15, Guido van Rossum wrote:
>
>> Yes, you can use the |= operator instead.
>>
>> |= is not quite the same as .update because it rebinds, so if the name on
> the LHS isn't local it'll raise NameError.
>
> Does that matter?
Not for my
shes,
Lucas Wiman
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/
On Fri, Oct 13, 2017 at 11:35 AM, Chris Angelico wrote:
> On Sat, Oct 14, 2017 at 5:16 AM, Antoine Rozo
> wrote:
> [...]
> Can we consider making itertools a package and adding a module
> > itertools.recipes that implements all these utilility functions?
>
> Check out more-itertools on PyPI - m
On Thu, Sep 21, 2017 at 8:23 AM, Victor Stinner
wrote:
> While I was first in favor of extending the Python syntax, I changed
> my mind. Float constants written in hexadecimal is a (very?) rare use
> case, and there is already float.fromhex() available.
>
> A new syntax is something more to learn
On Wed, Sep 13, 2017 at 11:55 AM, Serhiy Storchaka
wrote:
> [...] Calling __getattr__() will slow down the access to builtins. And
> there is a recursion problem if module's __getattr__() uses builtins.
>
The first point is totally valid, but the recursion problem doesn't seem
like a strong arg
On Tue, Aug 1, 2017 at 6:01 AM, Louie Lu wrote:
> [...]
> I'm not sure if this is discuss before, but can "any" and "all"
> support like min_max "arg1, arg2, *args" style?
>
Can this be done consistently? For example consider x=[[]]. Then all(x)
where x is interpreted as an iterable should be Fa
On Thu, Jul 20, 2017 at 5:19 AM, Victor Stinner
wrote:
> For me, namedtuple was first used to upgrade an old API from returning a
> tuple to a "named" tuple. There was a hard requirement on backward
> compatibility: namedtuple API is a superset of the tuple API.
>
> For new code, there is no such
On Sun, Jul 2, 2017 at 4:54 AM, Steven D'Aprano wrote:
> I think that the current status is that the MyPy folks, including Guido,
> consider that it *is* reasonable to ask these questions for the purpose
> of introspection, but issubclass and isinstance are not the way to do
> it.
>
That may hav
ther in the typing repo itself.
Apologies for the digression.
- Lucas
On Sun, Jun 25, 2017 at 11:13 AM, Koos Zevenhoven wrote:
> On Sun, Jun 25, 2017 at 8:47 PM, Lucas Wiman
> wrote:
>
>> > Yes, but then `isinstance(tuple(range(100)), Tuple[int, ...])`
>> would be a diff
anything to do with
speed.
- Lucas
On Sun, Jun 25, 2017 at 10:11 AM, Koos Zevenhoven wrote:
> On Sun, Jun 25, 2017 at 7:13 PM, Lucas Wiman
> wrote:
> [...]
>
>> >>> from typing import *
>> >>> isinstance(0, Union[int, float])
>> Traceback (mos
es welcomed, of course!
<http://www.dictionary.com/browse/more-things-in-heaven-and-earth--horatio>
On Sun, Jun 25, 2017 at 6:21 AM, rym...@gmail.com wrote:
> For some background on the removal of __instancecheck__, check the linked
> issues here:
>
>
> https://github.com/python/typin
>
> And what about PEP544 (protocols), which is being drafted? The PEP seems
> to aim for having type objects that represent duck-typing
> protocols/interfaces. Checking whether a protocol is implemented by an
> object or type is clearly a useful thing to do at runtime, but it is not
> really clear
://mail.python.org/pipermail/python-ideas/2015-April/thread.html#32907
- Lucas
On Thu, Jun 8, 2017 at 12:15 AM, Stephen J. Turnbull <
turnbull.stephen...@u.tsukuba.ac.jp> wrote:
> Lucas Wiman writes:
>
> > > Maps with a known, fixed set of keys are relatively uncommon
> &g
>
> Maps with a known, fixed set of keys are relatively uncommon
> in Python, though.
This is false in interacting with HTTP services, where frequently you're
working with deserialized JSON dictionaries you expect to be in a precise
format (and fail if not).
On Wed, Jun 7, 2017 at 11:32 PM, Greg
I agree that the stated use cases are better handled with ExitStack. One
area where `defer` might be useful is in lazy-evaluating global constants.
For example in a genomics library used at my work, one module involves
compiling a large number of regular expressions, and setting them as global
con
I like the aesthetic of the idea, but it seems like this would be a better
fit in a library namespace like sympy or jupyter.
On Thu, Jun 1, 2017 at 12:19 AM, Sven R. Kunze wrote:
> On 01.06.2017 08:47, Serhiy Storchaka wrote:
>
> What you are think about adding Unicode aliases for some mathemati
29 matches
Mail list logo