Michael Smith writes:
> This is just a small improvement, but worthwhile. It's intuitive IMO to be
> able to use similar filtering expressions to comprehensions at the top of a
> for loop.
Intuitive I guess, but in comprehensions it was "strictly from need"
since comprehension syntax is an exp
On Wed, Mar 02, 2022 at 05:01:38PM +0900, Stephen J. Turnbull wrote:
> My 63-year-old eyes struggle with 80-character lines, but in all
> fairness to those with better eyesight I'm not going to argue for
> Mom's 65[1].
This is a very good point that the "80 columns is too short" crowd
forget. 80
On Tue, Mar 01, 2022 at 09:27:05PM -0800, Christopher Barker wrote:
> I think it's really the equivalent of
>
> for x in y:
> if not x in c:
> break
> do_stuff
>
> which to me give the proposed syntax a bit more relative strength.
Forgotten the difference between continue and br
On Wed, 2 Mar 2022 at 10:27, Steven D'Aprano wrote:
> Off-topic, but since you raised the issue... is there a standard
> functional programming term for a variant of map() that applies a single
> argument to a series of different functions?
>
> # regular map
> map(func, list_of_args) # (
I've heard "evaluation map" for a related mathematical concept: the natural map
from X to (X -> Y) -> Y in some cartesian closed category (whatever that means
:-), like the natural embedding of a vector space into its double dual space,
or like this sort of eval_at function that you can then plu
Hi,
Currently shutil.copyfileobj returns nothing.
I would like to be able to find out how many bytes were copied.
Whilst most file-like objects have a .tell() which you could use, some don’t,
and .tell() is not guaranteed to measure the number of bytes, it could measure
with other units.
I don
On several functional languages that allow function invocations without
enclosing arguments in parentheses all functions take a single argument.
For multiple arguments the single argument is a tuple. For no arguments the
single argument is an empty tuple.
I've read the comments and I see more fear
I think I'm -0.5 but I have a question for the people on here smarter than
me (pretty much all):
Is there some opportunity for some kind of compiler magic when the iterable
of a for loop is fully contained in a place easily findable by the
compiler, and not spread over multiple if and for statemen
> On 2 Mar 2022, at 13:40, Davis, Matthew via Python-ideas
> wrote:
>
>
> Hi,
>
> Currently shutil.copyfileobj returns nothing.
> I would like to be able to find out how many bytes were copied.
>
> Whilst most file-like objects have a .tell() which you could use, some don’t,
> and .tell()
On Wed, Mar 2, 2022 at 2:25 AM Steven D'Aprano wrote:
> > I think it's really the equivalent of
> >
> > for x in y:
> > if not x in c:
> > break
> > do_stuff
> >
> > which to me give the proposed syntax a bit more relative strength.
>
> Forgotten the difference between continue an
On Thu, 3 Mar 2022 at 01:28, Ricky Teachey wrote:
>
> I think I'm -0.5 but I have a question for the people on here smarter than me
> (pretty much all):
>
> Is there some opportunity for some kind of compiler magic when the iterable
> of a for loop is fully contained in a place easily findable b
I have on a few occasions wanted a for..in..if statement and if it existed
would
have used it. However, I agree that the level of change a new statement type
brings to the language is probably too high for this feature.
But what if python lifted the newline requirement for blocks that contain
comp
I really am shocked by how many people seem to have broken ENTER keys on
their keyboards.
Let's just keep Python readable rather than see how much we can cram on a
line.
On Wed, Mar 2, 2022, 2:56 PM Jeremiah Paige wrote:
> I have on a few occasions wanted a for..in..if statement and if it exist
On Tue, Mar 1, 2022 at 4:51 PM Steven D'Aprano wrote:
> Then Python is the wrong language for you, because it uses exceptions to
> direct control flow *wink*
>
> The iteration protocol uses StopIteration to end iteration. The older
> sequence protocol uses IndexError for the same purpose.
>
I th
On Wed, Mar 02, 2022 at 09:25:01AM -0500, Ricky Teachey wrote:
> Is there some opportunity for some kind of compiler magic when the iterable
> of a for loop is fully contained in a place easily findable by the
> compiler, and not spread over multiple if and for statements?
I am not an expert on c
I have had precisely the same idea.
It feels better to make this feature general (if introduced at all) than
make it specific to 'for' + 'if'.
I think there would have to be a rule that any 'if' that appeared on a
line with other suite-introducing-statements could not have a
corresponding 'else
On 02/03/2022 20:03, David Mertz, Ph.D. wrote:
I really am shocked by how many people seem to have broken ENTER keys
on their keyboards.
You mock. (As far as I remember you are always opposed to new language
features/changes.)
But the proposal would give people the choice of
Saving a lev
On 02/03/2022 20:03, David Mertz, Ph.D. wrote:
I really am shocked by how many people seem to have broken ENTER keys
on their keyboards.
You mock. (As far as I remember you have always opposed new language
features/changes. Correct me if I am wrong.)
But the proposal would give people the c
18 matches
Mail list logo