This is a proposal for a new syntax where a comprehension is written as the
appropriate brackets containing a loop which can contain arbitrary statements.
Here are some simple examples. Instead of:
[
f(x)
for y in z
for x in y
if g(x)
]
one may write:
On Thu, Feb 20, 2020 at 12:43 PM Steve Jorgensen wrote:
>
> > But frankly, it would be a rare case where this would be noticeable.
> > -CHB
>
> Maybe uncommon, but I don't know about rare. Let's say you want to perform
> list-wise computations, making new lists with results of operations on
>
+1
On Thu, Feb 20, 2020 at 11:46 Alex Hall wrote:
> Christopher Barker wrote:
> > I think it’s a “Bad Idea” to use an environment variable — who knows what
> > Python script may be running on a given system?
> > But a standard command line argument to the interpreter could be useful.
>
> Can
> Let's plan a cmdline argument then.
> Should we go for -L much like -W?
Yeah, I think a command-line argument is much more reasonable, less likely
to cause issues with other implementations of logging configuration, and
more practically useful. I'd be +1 on something like a `-L`.
On Thu, Feb
On Thu, Feb 20, 2020 at 2:11 PM Chris Angelico wrote:
> On Fri, Feb 21, 2020 at 8:52 AM Stephan Hoyer wrote:
> >
> > On Thu, Feb 20, 2020 at 12:41 PM Steve Jorgensen
> wrote:
> >>
> >> Christopher Barker wrote:
> >> ...
> >> > > Perhaps the OP wanted the internal array size initialized, but
On Fri, Feb 21, 2020 at 8:52 AM Stephan Hoyer wrote:
>
> On Thu, Feb 20, 2020 at 12:41 PM Steve Jorgensen wrote:
>>
>> Christopher Barker wrote:
>> ...
>> > > Perhaps the OP wanted the internal array size initialized, but not used.
>> > Currently the internal array will automatically be
On Thu, Feb 20, 2020 at 12:41 PM Steve Jorgensen wrote:
> Christopher Barker wrote:
> ...
> > > Perhaps the OP wanted the internal array size initialized, but not
> used.
> > Currently the internal array will automatically be reallocated to grow as
> > needed. Which could be a performance hit if
Christopher Barker wrote:
...
> > Perhaps the OP wanted the internal array size initialized, but not used.
> Currently the internal array will automatically be reallocated to grow as
> needed. Which could be a performance hit if you know it’s going to grow
> large.
> But frankly, it would be a
Guido van Rossum wrote:
> On Thu, Feb 20, 2020 at 01:39 Steve Jorgensen ste...@stevej.name wrote:
> > It seems to me that this could simply be a package on
> > pypi rather than
> > being added to the Python standard library.
> > Sure. But the interesting part is how to design the API. I’ve seen a
Christopher Barker wrote:
> I think it’s a “Bad Idea” to use an environment variable — who knows what
> Python script may be running on a given system?
> But a standard command line argument to the interpreter could be useful.
Can you clarify what the concern is about other Python scripts
On Thu, Feb 20, 2020 at 01:39 Steve Jorgensen wrote:
> It seems to me that this could simply be a package on pypi rather than
> being added to the Python standard library.
>
Sure. But the interesting part is how to design the API. I’ve seen a number
of interesting ideas in this thread.
--
I think it’s a “Bad Idea” to use an environment variable — who knows what
Python script may be running on a given system?
But a standard command line argument to the interpreter could be useful.
-CHB
On Thu, Feb 20, 2020 at 8:51 AM Mike Miller
wrote:
>
> On 2020-02-19 17:12, Bar Harel wrote:
On 2020-02-19 17:12, Bar Harel wrote:
Another idea I've had that may be of use:
PYTHONLOGGING environment variable.
Setting PYTHONLOGGING to any log level or level name will initialize
logging.basicConfig() with that appropriate level.
Another option would be that -x dev or a different -x
On Thu, Feb 20, 2020 at 7:34 AM Serhiy Storchaka
wrote:
> 20.07.11 23:48, Sven Rahmann пише:
> > What's missing is the possiblity to specify the final size of the
> > array (number of items), especially for large arrays.
>
> array.array(typecode, [fillvalue]) * n
Perhaps the OP wanted the
This last is for discussion of changes to the Python language itself, in
particular the CPython reference implementation. Python-list or a Pandas
forum are appropriate for this question.
That said, it sounds like you want df.value_counts(). But if not, follow-up
in a more relevant place.
On Thu,
20.07.11 23:48, Sven Rahmann пише:
At the moment, the array module of the standard library allows to
create arrays of different numeric types and to initialize them from
an iterable (eg, another array).
What's missing is the possiblity to specify the final size of the
array (number of items),
I discovered that same trick. It would be nice to have that specifically
indicated in the documentation until/unless a length argument is added to the
constructor.
It would be nice for the supported operators to be documented at all, actually.
I didn't realize that array.array had
On Wed, Feb 19, 2020 at 5:23 PM FilippoM wrote:
>
> Hi, I've got a Pandas data frame that looks like this
>
> In [69]: data.head
> Out[69]:
> 0 AndroidVIDEO_OK
> 1 Android 4.2.2 VIDEO_OK
> 2 Android 9 VIDEO_OK
> 3 iOS 13.3 VIDEO_OK
> 4
>
> > If you want it only temporarily for debugging purposes, or permanently
> for all scripts in your system, it's not really feasible.
>
> Hmm, I'm not sure that I like the idea of overriding the default logging
> level being set system-wide, or that there would be an especially strong
> use
It seems to me that this could simply be a package on pypi rather than being
added to the Python standard library.
___
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
Currently, if I know that I want an `array.array` object with `itemsize` of 4
there is no way to do that without first determining what the item sizes are
for `'i'`/`'I'` and `'l'`/`'L'` on the current platform. Presumably, things
could get even more hairy with future platforms.
Below are
21 matches
Mail list logo