On Fri, 29 Jan 2021 at 14:37, Francis O'Hara Aidoo
wrote:
> I understand that the same effect can be achieved with the index notation
> - as in
> if listy[-1] == 10:
> print("Monty Python")
> - but the way that came naturally to me was to use the .index method
> rather than index notation, an
I definitely agree with that sentiment, with beginners I don't even talk
about function defaults at first, and when I do, it's when we have already
have a talk about mutables so I can just say that you almost never want a
mutable default but rather use None as a sentinel. It's not that hard and
it
> . In fact, I'd be
> pretty certain that something like this probably already exists on
> PyPI, but I wouldn't know how to find it.
It's supported with several syntaxes in macropy (
https://pypi.org/project/MacroPy/) but I remember seeing it in a more
serious (for lack of a better term) package t
Ah yes, it's pipeop ! https://pypi.org/project/pipeop/
On Fri, 26 Nov 2021 at 22:39, Evpok Padding wrote:
> > . In fact, I'd be
> > pretty certain that something like this probably already exists on
> > PyPI, but I wouldn't know how to find it.
>
>
Hi,
All apologies if it has been clarified earlier, but if you dislike nested
method calls what is wrong with operating on generators as in
```pycon
>>> itr = (i**2 for i in range(8))
>>> itr = (i-1 for i in itr if i > 0)
>>> list(itr)
[0, 3, 8, 15, 24, 35, 48]
```
This covers chains of maps and
Hi,
[xdg](https://pypi.org/project/xdg).xdg_config_home seems to give you the
parent of what you need, doesn't it?
Cheers,
E
On Wed, 15 Dec 2021 at 13:47, JGoutin via Python-ideas <
[email protected]> wrote:
> Hello,
>
> The idea is to add 3 functions to get "config", "data" and "cache"
Even if you think this is clever or funny, are you absolutely sure you
needed to share it with the subscribers to this mailing list?
On Tue, 31 Mar 2020 at 17:46, Andrew Barnert via Python-ideas <
[email protected]> wrote:
> Dear Sir, I wish to complain in the strongest possible terms about
Hey,
You can always do `itertools.chain.from_iterable(zip(iterable,
itertools.repeat(sep)))` but I agree that it is verbose.
Cheers,
E
On Wed, 9 Dec 2020 at 04:16, wrote:
> Hi
>
> I like using itertools for creating long strings while not paying the cost
> of intermediate strings (by eventual
For simple cases such as `[y + g(y) for y in [f(x) for x in range(10)]]`,
I don't really see what the issue is, if you really want to make it shorter,
you can ``[y + g(y) for y in map(f,range(10))]` which is one of the rare
case where I like `map` more than comprehensions.
For more complex case, j
On 11 April 2018 at 23:09, Brendan Barnwell wrote:
> On 2018-04-11 11:05, David Mertz wrote:
>
>> How about this, Brendan?
>>
>> _, x1, x2 = (D := b**2 - 4*a*c), (-b + sqrt(D))/2, (-b - sqrt(D))/2
>>
>> I'm not sure I love this, but I don't hate it.
>>
>
> That's clever, but why bother?
10 matches
Mail list logo