On Sat, Oct 2, 2021, 10:20 PM Christopher Barker
wrote:
>
> But sure, if we can eliminate inefficiencies in Python standard data
> types, then why not?
>
Because the C implementation becomes hard to maintain.
All of our linear containers could benefit from non-linear implementations
in some sce
On Sat, May 1, 2021 at 10:49 AM Gregory Szorc
wrote:
> The way it works today, if you have an application embedding Python, your
> sys.argv[0] is (likely) your main executable and sys.executable is probably
> None or the empty string (per the stdlib docs which say not to set
> sys.executable if t
Given I've never even heard of Strunk & White (my own privilege i'd
assume)... yeah. I don't actually know what the existing "When writing
English, follow Strunk and White." text in PEP-8 even means.
It doesn't hyperlink to an online source for English style probably because
this was written so l
On Tue, Jun 9, 2020 at 5:49 PM Naomi Ceder wrote:
> FWIW...
>
> As someone who has spent at least the last 5 years trying (unsuccessfully)
> to reprogram 15 years of muscle memory of print as a statement, I vote +1
> to print without parens.
>
> As someone who teaches Python and groans at explain
On Wed, Apr 8, 2020, 10:37 AM Antoine Pitrou wrote:
> On Wed, 8 Apr 2020 10:18:47 -0700
> Guido van Rossum wrote:
> >
> > > But when I leave "large" temp objects hanging and
> > > give a rip, I already stick in "del" statements anyway. Very rarely,
> > > but it happens.
> > >
> >
> > I recall t
On Wed, Apr 8, 2020 at 10:21 AM Guido van Rossum wrote:
> On Wed, Apr 8, 2020 at 10:05 AM Alex Hall wrote:
>
>> This would break uses of locals(), e.g.
>>
>
> Hm, okay, so suppose the code analysis was good enough to recognize most
> un-obfuscated uses of locals(), exec() and eval() (and presuma
On Tue, Feb 4, 2020 at 3:29 AM Chris Angelico wrote:
>
> Another one to throw into the mix: Trailing underscores, but only if
> the expression is incomplete. So in simple cases like this, that means
> parenthesizing the number:
>
> P = (29674495668685510550154174642905332730771991_
> 7998
On Sun, Nov 3, 2019 at 12:33 AM Brendan Barnwell
wrote:
> On 2019-11-03 00:02, Eric V. Smith wrote:
> > On 11/2/2019 10:02 PM, Jonathan Goble wrote:
> >> So there's no reason in that regard to not allow it, and I'm +1 on the
> idea.
> >
> > I disagree. I don't think there's precedent in Python fo
On Thu, Oct 24, 2019 at 3:21 PM Guido van Rossum wrote:
> OK, let's see if we can do CC0. Todd, do you want to read through the link
> Steven gave and find out how we should apply this, either to just the
> itertools examples, or possibly to all examples in the docs?
>
Obviously all examples in
On Fri, Sep 27, 2019 at 5:21 PM Guido van Rossum wrote:
> On Fri, Sep 27, 2019 at 11:18 AM Serhiy Storchaka
> wrote:
>
>> I think it needs an explicit support in the type creation machinery (as
>> __slots__ itself has) to support descriptors and slots with the same name.
>>
>
> That would be tou
On Sun, Mar 24, 2019 at 5:16 AM Giampaolo Rodola'
wrote:
> It turns out we could use resource.getrusage() which provides micro
> seconds (tested on Linux and macOS):
>
> import os, resource
> for x in range(1000): # warm up
> pass
> for x in range(5):
> a = os.tim
I don't think this belongs in subprocess. It isn't related to processes
creation.
A module on PyPI with the Windows code would make more sense.
On Wed, Mar 20, 2019 at 3:19 PM eryk sun wrote:
> On 3/18/19, Giampaolo Rodola' wrote:
> >
> > I've been having these 2 implemented in psutil for a l
On Sat, Mar 23, 2019 at 11:00 AM Stefan Krah wrote:
> On Sat, Mar 23, 2019 at 10:37:43AM -0700, Gregory P. Smith wrote:
> > A useless statement like that isn't likely to be typed. I've never seen
> > anyone do that.
>
> Unlikely yes, but ideally type annot
On Sat, Mar 23, 2019 at 7:37 AM Andre Roberge
wrote:
> Consider the following example [1]:
>
> Python 3.7.0 (v3.7.0:1bf9cc5093...
> >>> d = {
> ... "injury": "flesh wound"
> ... }
> >>> d["answer"]: 42
> >>> if "answer" in d:
> ... print("Don't panic!")
> ... else:
> ... print(
On Sat, Mar 16, 2019 at 5:02 AM Gustavo Carneiro
wrote:
> On Sat, 16 Mar 2019 at 10:33, Steven D'Aprano wrote:
>
>> On Fri, Mar 15, 2019 at 10:53:31PM +, MRAB wrote:
>>
>> > There was also the suggestion of having both << and >>.
>> >
>> > Actually, now that dicts are ordered, that would pro
On Mon, Feb 25, 2019 at 2:05 AM INADA Naoki wrote:
> I think long URL in comment or docstring is good reason to ignore
> line length limit.
>
Yep, that's what we do in the yapf autoformatter. There's good reason too,
source viewers and editors linkify URLs, if you break them across strings
to f
On Thu, Jan 17, 2019 at 2:34 PM Till wrote:
> We started a discussion in https://github.com/python/typing/issues/600
> about adding support for extra annotations in the typing module.
>
> Since this is probably going to turn into a PEP I'm transferring the
> discussion here to have more visibilit
On Fri, Dec 7, 2018 at 3:38 PM Steven D'Aprano wrote:
> On Fri, Dec 07, 2018 at 01:25:19PM -0800, Nathaniel Smith wrote:
>
> > For this specific purpose, md5 is just as good as a proper hash. But all
> > else being equal, it would still be better to use a proper hash, just so
> > people don't hav
tes, one could have (1,2,7,2).to_bytes() instead of
>> bytes((1,2,7,2)) because b'\x01\x02\x07\x02' is long and boring.
>> What about variables in the values {1,2,x}.freeze() should work too ?
>> bytes((1,2,7,x)) is not writable as a b string and creates a copy.
>>
>&
On Wed, Jul 11, 2018 at 4:45 PM Jelle Zijlstra
wrote:
> 2018-07-11 16:25 GMT-07:00 Gregory P. Smith :
>
>> Completely obvious what it does, but it irritates my aesthetic
>> sensibilities every time I see:
>> frozenset({spam, eggs})
>>
>> Why? Because I assu
Completely obvious what it does, but it irritates my aesthetic
sensibilities every time I see:
frozenset({spam, eggs})
Why? Because I assume under the hood that creates a set of spam and eggs
before calling frozenset to copy it into a new frozenset object before the
original set is garbage colle
On Sat, Jun 23, 2018 at 12:57 PM Christian Heimes
wrote:
>
> If you need to protect sensitive data like private keys, then don't load
> them into memory of your current process. It's that simple. :) Bugs like
> heartbleed were an issue, because private key were in the same process
> space as the
On Mon, Apr 16, 2018 at 11:11 AM Ned Batchelder
wrote:
> On 4/16/18 1:42 PM, Chris Angelico wrote:
> > 3) "expr -> name" ==> The information went data way.
> >
> > So either you take a parallel from elsewhere in Python syntax, or you
> > take a hopefully-intuitive dataflow mnemonic symbol. Take y
On Tue, Apr 10, 2018 at 12:51 PM Eric V. Smith wrote:
>
> >> 3. Annotations. They are used mainly by third party tools that
> >> statically analyze sources. They are rarely used at runtime.
> >
> > Even less used than docstrings probably.
>
> typing.NamedTuple and dataclasses use annotations at r
On Thu, Mar 15, 2018 at 3:26 AM Nick Coghlan wrote:
> On 14 March 2018 at 15:20, Chris Billington
> wrote:
>>
>> I wonder if there's any reason something like this shouldn't be built
>> into Python's default import system.
>>
>
> There are two main challenges with enforcing such a check, one aff
On Tue, Feb 27, 2018 at 2:35 PM Chris Angelico wrote:
> This is a suggestion that comes up periodically here or on python-dev.
> This proposal introduces a way to bind a temporary name to the value
> of an expression, which can then be used elsewhere in the current
> statement.
>
> The nicely-ren
fwiw, we're going to need the tool name in any pragma anyways so the
existing thing that should be common is:
# tool-name: meaningfultoken
It seems like the only convention that makes sense to me.
When I saw your flake8 example of "# noqa: F401" I wanted to rip my eyes
out. Because it didn't men
Neil, you might also bring this up on the
http://lists.idyll.org/listinfo/testing-in-python list as I suspect people
there have opinions on this topic.
-gps
On Mon, Aug 21, 2017 at 9:07 AM Ned Batchelder
wrote:
> On 8/20/17 9:32 PM, Neil Girdhar wrote:
>
> This question describes an example of
On Thu, May 18, 2017 at 6:38 PM Eric V. Smith wrote:
> On 5/18/17 2:26 PM, Sven R. Kunze wrote:
> > On 17.05.2017 23:29, Ivan Levkivskyi wrote:
> >> the idea is to write it into a PEP and consider API/corner
> >> cases/implementation/etc.
> >
> > Who's writing it?
>
> Guido, Hynek, and I met toda
On Mon, Jun 5, 2017 at 10:52 AM Chris Barker wrote:
> On Mon, Jun 5, 2017 at 3:55 AM, Victor Stinner
> wrote:
>
>> A minimum change would be to add the (empty string) at the end of
>> sys.path in Python 3.7 rather than adding it at the start.
>>
>> It would increase Python usability since it avo
Makes sense, thanks! math.fma() it is. :)
On Tue, Jan 17, 2017, 7:48 AM Stephan Houben wrote:
> Hi Xavier,
>
> In this bright age of IEEE-754 compatible CPUs,
> it is certainly possible to achieve reproducible FP.
> I worked for a company whose software produced bit-identical
> results on vario
Is there a good reason not to detect single expression multiply adds and
just emit a new FMA bytecode?
Is our goal for floats to strictly match the result of the same operations
coded in unoptimized C using doubles?
Or can we be more precise on occasion?
I guess a similar question may be asked o
At a glance, all of these sound like good modernizing enhancements for
cprofile. It just takes someone to contribute the work. :)
On Tue, Jan 10, 2017, 8:57 AM Ethan Furman wrote:
> On 01/10/2017 08:36 AM, Thane Brimhall wrote:
>
> > Does anyone have thoughts on this topic? I assume the silence
33 matches
Mail list logo