[Python-ideas] Re: [Python-Dev] Re: Have virtual environments led to neglect of the actual environment?

2021-02-24 Thread Antoine Pitrou
On Wed, 24 Feb 2021 13:47:40 +0100 Stéfane Fermigier wrote: > On Wed, Feb 24, 2021 at 12:42 PM Paul Moore > wrote: > > > On Wed, 24 Feb 2021 at 10:55, Stéfane Fermigier > > wrote: > > > There is probably a clever way to reuse common packages (probably via > > clever symlinking) and reduce

[Python-ideas] Toxic forum

2018-08-13 Thread Antoine Pitrou
On Sun, 12 Aug 2018 23:56:24 -0500 Abe Dillon wrote: > > This forum is looking more and more toxic. I've explained myself over and > over again. I just wanted to +1 Steven's original comment. This is > ridiculous. I guess I've pissed of the good-old-boys by calling out > Steven's unnecessary co

Re: [Python-ideas] REPL features

2018-08-22 Thread Antoine Pitrou
On Wed, 22 Aug 2018 09:38:57 -0700 Chris Barker via Python-ideas wrote: > On Tue, Aug 21, 2018 at 3:07 PM, Jonathan Fine wrote: > > > > Maybe this is something Python's REPL should do? > > > > Good idea. > > > > I can't find (with very little effort) any documentation of this, but I > have

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Antoine Pitrou
On Thu, 13 Sep 2018 11:55:40 +0200 "Giampaolo Rodola'" wrote: > > This is simply ridiculous. I'm not sure if this is political > correctness pushed to its limits or just trolling. Indeed she might be trolling. Though the fact we're hesitating on the diagnosis shows how far reality has come on t

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Antoine Pitrou
Hi Samantha, You ask others to be open-minded, but fail to show such an attitude yourself. Beauty is a very old and important concept in the history of human societies, present in most or all of them, and has been the subject of a wide range of interpretations, studies and theories. And, as a F

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Antoine Pitrou
On Thu, 13 Sep 2018 12:32:43 +0200 Oleg Broytman wrote: > On Thu, Sep 13, 2018 at 12:22:14PM +0200, Jacco van Dorp > wrote: > > I'm pleasantly surprised by the general response here. I was taking it > > seriously because, well, that's how far it's going everywhere. > > 1. I couldn't believe i

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-13 Thread Antoine Pitrou
On Thu, 13 Sep 2018 09:16:17 -0400 Calvin Spealman wrote: > > I came into this thread reading the subject and thinking "over my dead > body!" until I read your well-thought reasoning and gave even a little bit > of thought to the idea. > > You're absolutely right and while I think its very unlik

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-14 Thread Antoine Pitrou
On Fri, 14 Sep 2018 10:47:07 +1200 Greg Ewing wrote: > M.-A. Lemburg wrote: > > For > > me, it refers to a general feeling of consistency, pureness and > > standing out on its own. It's abstract and doesn't have > > anything to do with humans. > > Yep. And the proposed replacement "clean/dirty

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-15 Thread Antoine Pitrou
On Fri, 14 Sep 2018 22:09:06 +0200 Davide Rizzo wrote: > > In this case, I even see the potential to convey the original message > in a more powerful way than the current formulation does. I'm not a > good candidate for this, as the chosen language for this community is > English, which is not my

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-16 Thread Antoine Pitrou
Yeah, right. You know, when I was pointing out Calvin not being very brave by attacking a bunch of people without giving names, my aim was to merely point out how dishonest and disrespectful his attitude his. *Not* to encourage someone to turn his post into more of a clusterfuck of personal att

Re: [Python-ideas] Retire or reword the "Beautiful is better than ugly" Zen clause

2018-09-16 Thread Antoine Pitrou
On Sun, 16 Sep 2018 13:32:26 -0400 "Franklin? Lee" wrote: > On Sun, Sep 16, 2018 at 4:14 AM Antoine Pitrou wrote: > > > > Yeah, right. > > > > You know, when I was pointing out Calvin not being very brave by > > attacking a bunch of people without givin

Re: [Python-ideas] Retire or reword the namesake of the Language

2018-09-17 Thread Antoine Pitrou
It's not like the Monty Python (whom the language was named after) would have dared mocking the discourse and manners of all kinds of social groups, let alone have a laugh at the expense of beliefs and ideologies. Regards Antoine. On Mon, 17 Sep 2018 08:25:27 -0400 Calvin Spealman wrote: > I

Re: [Python-ideas] Retire or reword the namesake of the Language

2018-09-18 Thread Antoine Pitrou
On Mon, 17 Sep 2018 22:06:28 -0400 "Franklin? Lee" wrote: > Monty Python had the goal of making people laugh, while python-ideas > has the goal of improving Python. With those priorities, we can have > fun, but not at the expense of potential contributions and > contributors. You are right. Rega

Re: [Python-ideas] Moving to another forum system where

2018-09-19 Thread Antoine Pitrou
On Tue, 18 Sep 2018 18:37:09 -0400 James Lu wrote: > * The mailing list is frankly obscure. Python community leaders and package > maintainers often are not aware or do not participate in Python-ideas. Not > many people know how to use or navigate a mailing list. > * No one really promotes the

Re: [Python-ideas] Moving to another forum system where

2018-09-19 Thread Antoine Pitrou
On Wed, 19 Sep 2018 11:54:20 -0400 James Lu wrote: > Oh wow, Google Groups is actually a much better interface. Depends who you talk to. For me, having to use the Google Groups UI would be a strong impediment to my continued contribution. Regards Antoine. > > Any better forum software needs

Re: [Python-ideas] Moving to another forum system where moderation is possible

2018-09-20 Thread Antoine Pitrou
On Thu, 20 Sep 2018 09:58:03 -0700 Brett Cannon wrote: > > Ethan's correct, it isn't enough. The past two weeks have been pretty > horrible for me as an admin and Titus and I need to find a solution to keep > this place sustainable long-term, otherwise I'm liable to burn out from > running this l

[Python-ideas] "slur" vs "insult"?

2018-09-21 Thread Antoine Pitrou
Hi, For the record I was surprised to see the word "slur" pop up quite often recently, while I'd only heard "insult" before. I looked it up and it doesn't help that the French translation seems to be the same in both cases (it's "insulte"). Then I came upon this thread where someone pretty muc

Re: [Python-ideas] Suggestion: Extend integers to include iNaN

2018-09-29 Thread Antoine Pitrou
On Fri, 28 Sep 2018 23:52:22 -0700 Nathaniel Smith wrote: > On Fri, Sep 28, 2018 at 11:31 PM, Steve Barnes wrote: > > One specific use case that springs to mind would be for Libraries such > > as Pandas to return iNaN for entries that are not numbers in a column > > that it has been told to treat

Re: [Python-ideas] Better error messages for missing optional stdlib packages

2018-10-04 Thread Antoine Pitrou
On Thu, 4 Oct 2018 08:32:55 +1000 Steven D'Aprano wrote: > > > Also, maybe add a little note in the docs, stating that despite being > > part of stdlib this module might not be available on all systems. > > That should be uncontroversial. Raise an issue on the bug tracker for > that, or a pa

Re: [Python-ideas] support toml for pyproject support

2018-10-09 Thread Antoine Pitrou
On Mon, 8 Oct 2018 09:26:12 -0400 David Mertz wrote: > I agree here. I briefly urged against using the less used TOML format, but > I have no real skin in the game around packaging. I like YAML, but that's > also not in the standard library, even if more widely used. Agreed with David. Also, ple

Re: [Python-ideas] Add closing and iteration to threading.Queue

2018-10-21 Thread Antoine Pitrou
On Sun, 21 Oct 2018 19:58:05 +0200 Vladimir Filipović wrote: > > To anticipate a couple more possible questions: > > - What would this proposal do about multiple producers/consumers > needing to jointly decide _when_ to close the queue? > > Explicitly nothing. > > The queue's state is either c

Re: [Python-ideas] PEP 543-conform TLS library

2018-10-26 Thread Antoine Pitrou
On Fri, 26 Oct 2018 17:41:26 +0200 Mathias Laurin wrote: > > So, can anybody clarify these two points from the PEP? > > Or should I just address Cory Benfield (who does not seem very > active anymore lately) and Christian Heimes directly? Either that, or post on python-dev where you'll be more

Re: [Python-ideas] Add "default" kwarg to list.pop()

2018-10-31 Thread Antoine Pitrou
On Wed, 31 Oct 2018 02:25:25 +0200 Serhiy Storchaka wrote: > 31.10.18 01:44, Giampaolo Rodola' пише: > > Sorry in advance if this has been proposed in the past but I couldn't > > find anything on python-ideas: > > > > >>> l = [] > > >>> l.pop(default=1) > > 1 > > > > FWIW my use case cons

Re: [Python-ideas] Add "default" kwarg to list.pop()

2018-10-31 Thread Antoine Pitrou
On Wed, 31 Oct 2018 00:44:55 +0100 "Giampaolo Rodola'" wrote: > Sorry in advance if this has been proposed in the past but I couldn't find > anything on python-ideas: > > >>> l = [] > >>> l.pop(default=1) > 1 > > FWIW my use case consists in reading entries from /proc/diskstats where > lines c

Re: [Python-ideas] [Brainstorm] Testing with Documented ABCs

2018-11-28 Thread Antoine Pitrou
On Tue, 27 Nov 2018 22:47:06 -0600 Abe Dillon wrote: > > If we could figure out a cleaner syntax for defining invariants, > preconditions, and postconditions we'd be half-way to automated testing > UTOPIA! (ok, maybe I'm being a little over-zealous) I think utopia is the word here. Fuzz testing

Re: [Python-ideas] [Brainstorm] Testing with Documented ABCs

2018-11-28 Thread Antoine Pitrou
On Wed, 28 Nov 2018 15:58:24 -0600 Abe Dillon wrote: > Thirdly, Computers are very good at exhaustively searching multidimensional > spaces. How long do you think it will take your computer to exhaustively search the space of possible input values to a 2-integer addition function? Do you think i

Re: [Python-ideas] [Brainstorm] Testing with Documented ABCs

2018-11-28 Thread Antoine Pitrou
Mertz a écrit : > That's easy, Antoine. On a reasonable modern multi-core workstation, I > can do 4 billion additions per second. A year is just over 30 million > seconds. For 32-bit ints, I can whiz through the task in only 130,000 > years. We have at least several hundred million

Re: [Python-ideas] [Brainstorm] Testing with Documented ABCs

2018-11-29 Thread Antoine Pitrou
On Wed, 28 Nov 2018 23:22:20 -0200 Marcos Eliziario wrote: > But nobody is talking about exhausting the combinatoric space of all > possible values. Property Based Testing looks like Fuzzy Testing but it is > not quite the same thing. Well, the OP did talk about "exhaustively searching the multi

Re: [Python-ideas] Using sha512 instead of md5 on python.org/downloads

2018-12-07 Thread Antoine Pitrou
On Fri, 7 Dec 2018 09:53:04 +0100 Miro Hrončok wrote: > Hi, > > I see md5 checksums at a release download page such as [1]. > > My idea is to switch to sha512 for a more reliable outcome. > > I'm no security expert, but AFAK md5 is generally believed to be unsafe, > as it was repeatedly proven

Re: [Python-ideas] Using sha512 instead of md5 on python.org/downloads

2018-12-07 Thread Antoine Pitrou
On Fri, 7 Dec 2018 06:49:59 -0800 Devin Jeanpierre wrote: > On Fri, Dec 7, 2018 at 1:40 AM Antoine Pitrou wrote: > > > md5 is only used for a quick integrity check here (think of it as a > > sophisticated checksum). For security you need to verify the > > cor

Re: [Python-ideas] Using sha512 instead of md5 on python.org/downloads

2018-12-08 Thread Antoine Pitrou
On Fri, 7 Dec 2018 11:54:59 -0800 Devin Jeanpierre wrote: > On Fri, Dec 7, 2018 at 10:48 AM Antoine Pitrou wrote: > > > If the site is vulnerable to modifications, then TLS doesn't help. > > Again: you must verify the GPG signatures (since they are produced by > >

Re: [Python-ideas] Using sha512 instead of md5 on python.org/downloads

2018-12-10 Thread Antoine Pitrou
On Mon, 10 Dec 2018 07:31:44 +0100 Ronald Oussoren via Python-ideas wrote: > > That’s true, but it does show that switching from MD5 to SHA2 doesn’t make it > harder to validate the checksum on major platforms. > > I don’t have a strong opinion either way, I’m slightly in favour of switching

Re: [Python-ideas] TAPS Implementation

2018-12-10 Thread Antoine Pitrou
On Tue, 11 Dec 2018 09:31:36 +1100 Steven D'Aprano wrote: > Hi Max, and welcome! > > On Mon, Dec 10, 2018 at 09:47:07PM +, Franke, Maximilian Julian Shawn > wrote: > [...] > > We are currently looking into implementing TAPS, a novel way to offer > > transport layer services to the applicati

[Python-ideas] No need to add a regex pattern literal

2018-12-31 Thread Antoine Pitrou
On Thu, 27 Dec 2018 19:48:40 +0800 Ma Lin wrote: > We can use this literal to represent a compiled pattern, for example: > > >>> p"(?i)[a-z]".findall("a1B2c3") > ['a', 'B', 'c'] > > >>> compiled = p"(?<=abc)def" > >>> m = compiled.search('abcdef') > >>> m.group(0) > 'def' > > >>> rp'\W

Re: [Python-ideas] No need to add a regex pattern literal

2018-12-31 Thread Antoine Pitrou
Le 31/12/2018 à 12:31, M.-A. Lemburg a écrit : > > We already have re.search() and re.match() which deal with compilation > on-the-fly and caching. Perhaps the documentation should hint at this > more explicitly... The complaint is that the global cache is still too costly. See measurements in h

Re: [Python-ideas] NAN handling in the statistics module

2019-01-07 Thread Antoine Pitrou
On Sun, 6 Jan 2019 19:40:32 -0800 Stephan Hoyer wrote: > On Sun, Jan 6, 2019 at 4:27 PM Steven D'Aprano wrote: > > > I propose adding a "nan_policy" keyword-only parameter to the relevant > > statistics functions (mean, median, variance etc), and defining the > > following policies: > > > >

Re: [Python-ideas] Clearer communication

2019-02-03 Thread Antoine Pitrou
On Sat, 2 Feb 2019 21:20:40 +1100 Steven D'Aprano wrote: > > Core developer Brett Cannon has taken up editing other people's comments > on github if he doesn't approve of their tone. > > I'm now proactively editing people's comments on issues so > they are less aggressive, e.g. "You ne

Re: [Python-ideas] What factors led Guido to quit?

2019-02-03 Thread Antoine Pitrou
James, please don't post such topics on python-ideas. This is completely off-topic and has strong flamebait potential. You may write on your own blog or Facebook account if you feel so strongly about it. Regards Antoine. On Sat, 2 Feb 2019 11:04:40 -0500 James Lu wrote: > I want y’all to th

Re: [Python-ideas] PEP 8 update on line length

2019-02-22 Thread Antoine Pitrou
On Thu, 21 Feb 2019 11:59:56 -0800 Raymond Hettinger wrote: > > PEP 8 is mostly about readability. However, the line length limit often > seems to cause less readable code. There are well-known typography rules around line length and readability, both on screen and in print. See e.g.: https:/

Re: [Python-ideas] Dict joining using + and +=

2019-02-27 Thread Antoine Pitrou
On Wed, 27 Feb 2019 10:48:21 -0800 Guido van Rossum wrote: > > Great, this sounds like a good argument for + over |. The other argument is > that | for sets *is* symmetrical, [...] As much as it can be: >>> {-0.0} | {0.0} {-0.0} >>> {0.0} | {-0.0} {0.0} ;-) Antoine.

Re: [Python-ideas] PEP: Dict addition and subtraction

2019-03-15 Thread Antoine Pitrou
On Wed, 6 Mar 2019 00:46:57 + Josh Rosenberg wrote: > > Overloading + lacks the clear descriptive aspect of update that describes > the goal of the operation, and contradicts conventions (in Python and > elsewhere) about how + works (addition or concatenation, and a lot of > people don't even

Re: [Python-ideas] PEP: Dict addition and subtraction

2019-03-15 Thread Antoine Pitrou
On Mon, 4 Mar 2019 16:02:06 +0100 Stefan Behnel wrote: > INADA Naoki schrieb am 04.03.19 um 11:15: > > Why statement is not enough? > > I'm not sure I understand why you're asking this, but a statement is "not > enough" because it's a statement and not an expression. This is an argument for Pe

Re: [Python-ideas] PEP: Dict addition and subtraction

2019-03-15 Thread Antoine Pitrou
On Mon, 4 Mar 2019 15:57:38 -0800 Guido van Rossum wrote: > > > Those two points make me uncomfortable with "+=" strictly behaving > > like ".update()". > > And yet that's how it works for lists. (Note that dict.update() still has > capabilities beyond +=, since you can also invoke it with keywo

Re: [Python-ideas] PEP: Dict addition and subtraction

2019-03-15 Thread Antoine Pitrou
On Thu, 7 Mar 2019 10:58:02 +1100 Chris Angelico wrote: > > Lots of words that basically say: Stuff wouldn't be perfectly pure. Chris, please learn to think twice before contributing what is essentially a trivialization of someone else's arguments. You're not doing anything useful here, and are

Re: [Python-ideas] PEP: Dict addition and subtraction

2019-03-16 Thread Antoine Pitrou
On Sat, 16 Mar 2019 01:41:59 +1100 Steven D'Aprano wrote: > > Matrix multiplication is a perfect example: adding the @ operator could > have been done in Python 0.1 if anyone had thought of it, but it took 15 > years of numerical folk "whinging" about the lack until it happened: Not so perfect

Re: [Python-ideas] PEP: Dict addition and subtraction

2019-03-16 Thread Antoine Pitrou
On Sat, 16 Mar 2019 01:59:07 +1100 Steven D'Aprano wrote: > On Fri, Mar 15, 2019 at 12:25:22PM +0100, Antoine Pitrou wrote: > > > Yeah, well I do think "+=" for lists was a mistake. I *still* have > > trouble remembering the exact difference between &qu

Re: [Python-ideas] PEP: Dict addition and subtraction

2019-03-16 Thread Antoine Pitrou
On Sat, 16 Mar 2019 03:44:02 +1100 Steven D'Aprano wrote: > On Fri, Mar 15, 2019 at 12:34:45PM +0100, Antoine Pitrou wrote: > > On Thu, 7 Mar 2019 10:58:02 +1100 > > Chris Angelico wrote: > > > > > > Lots of words that basically say: Stuff wouldn't

Re: [Python-ideas] Why operators are useful

2019-03-16 Thread Antoine Pitrou
On Fri, 15 Mar 2019 10:51:11 -0700 Guido van Rossum wrote: > Of course, everything comes at a price. You have to learn the operators, > and you have to learn their properties when applied to different object > types. That's not the only price, though. If "+" is added to dicts, then we're overloa

Re: [Python-ideas] Why operators are useful

2019-03-18 Thread Antoine Pitrou
On Mon, 18 Mar 2019 14:06:53 + Rhodri James wrote: > On 16/03/2019 12:01, Gustavo Carneiro wrote: > > Already been said, but might have been forgotten, but the new proposed > > syntax: > > > > new = a + b > > > > has to compete with the already existing syntax: > > > > new = {**a,

Re: [Python-ideas] Add subprocess.Popen suspend() and resume()

2019-03-18 Thread Antoine Pitrou
Seems reasonable to me. Regards Antoine. On Mon, 18 Mar 2019 16:41:34 +0100 "Giampaolo Rodola'" wrote: > Hello, > I've been having these 2 implemented in psutil for a long time. On > POSIX these are convenience functions using os.kill() + SIGSTOP / > SIGCONT (the same as CTRL+Z / "fg"). On

Re: [Python-ideas] Why operators are useful

2019-03-19 Thread Antoine Pitrou
On Tue, 19 Mar 2019 10:49:41 +1300 Greg Ewing wrote: > Rémi Lapeyre wrote: > > > You can make "inferences from the way things are used". But the > > comparison with maths stops here, you don’t make such inferences because > > your > > object must be well defined before you start using it. > >

Re: [Python-ideas] PEP: Dict addition and subtraction

2019-03-21 Thread Antoine Pitrou
On Wed, 20 Mar 2019 15:46:24 -1000 Christopher Barker wrote: > > > This is precisely why I worded my question this way: what has changed > > in the last 20 years that make a "+" dict operator more compelling > > today than it was? Do we merge dicts much more frequently than we > > did? > > Th

Re: [Python-ideas] PEP: Dict addition and subtraction

2019-03-21 Thread Antoine Pitrou
On Thu, 21 Mar 2019 23:35:36 +1100 Chris Angelico wrote: > On Thu, Mar 21, 2019 at 10:35 PM Antoine Pitrou wrote: > > > but it's NOT a new operator, it is making use of an existing one, and sure > > > you could guess at a couple meanings, but the merge one is prob

Re: [Python-ideas] PEP: Dict addition and subtraction

2019-03-21 Thread Antoine Pitrou
On Thu, 21 Mar 2019 23:51:12 +1100 Chris Angelico wrote: > On Thu, Mar 21, 2019 at 11:45 PM Antoine Pitrou wrote: > > > > On Thu, 21 Mar 2019 23:35:36 +1100 > > Chris Angelico wrote: > > > On Thu, Mar 21, 2019 at 10:35 PM Antoine Pitrou > > > wrote:

Re: [Python-ideas] dict.merge(d1, d2, ...) (Counter proposal for PEP 584)

2019-03-21 Thread Antoine Pitrou
On Tue, 5 Mar 2019 16:39:40 +0900 INADA Naoki wrote: > I think some people in favor of PEP 584 just want > single expression for merging dicts without in-place update. > > But I feel it's abuse of operator overload. I think functions > and methods are better than operator unless the operator > h

Re: [Python-ideas] PEP: Dict addition and subtraction

2019-03-21 Thread Antoine Pitrou
On Fri, 22 Mar 2019 03:42:00 +1100 Steven D'Aprano wrote: > > For those who oppose the + operator, it will help me if you made it > clear whether it is *just* the + symbol you dislike, and would accept > the | operator instead, or whether you hate the whole operator concept > regardless of how

Re: [Python-ideas] PEP: Dict addition and subtraction

2019-03-21 Thread Antoine Pitrou
On Thu, 21 Mar 2019 17:59:41 + Rhodri James wrote: > > >> And to those who support this PEP, code examples where a dict merge > >> operator will help are most welcome! > > I don't use Python often enough to have much to offer, I'm afraid. The > sort of occasion I would use dict merging i

Re: [Python-ideas] Report an issue of Python

2019-03-21 Thread Antoine Pitrou
Hello, On Thu, 21 Mar 2019 15:31:30 -0400 Hardik Patel wrote: > Hello, > Can you please help me to contact a core team if it is possible. > I would like to report an issue. Issues can be reported at https://bugs.python.org/ Regards Antoine. ___ P

Re: [Python-ideas] Simpler thread synchronization using "Sticky Condition"

2019-03-26 Thread Antoine Pitrou
On Tue, 26 Mar 2019 09:27:18 - "Richard Whitehead" wrote: > Problem: > > Using Python's Condition class is error-prone and difficult. For example, > the following pseudo-code would be quite typical of its use: [...] Nowadays, I would recommend to always use `Condition.wait_for()` rather tha

Re: [Python-ideas] Backward-incompatible changes for Python 4

2019-04-01 Thread Antoine Pitrou
On Mon, 1 Apr 2019 10:41:40 -0400 Dan Sommers <2qdxy4rzwzuui...@potatochowder.com> wrote: > On 4/1/19 10:27 AM, Antoine Pietri wrote: > > > - The / operator returns floats, which loses information when both of > > the operands are integer. In Python 4, “1 / 2” should return a > > decimal.Decimal.

[Python-ideas] Logical tracebacks

2019-04-15 Thread Antoine Pitrou
Hello, I apologize because I'm only going to throw a very vague idea and I don't currently have time or motivation to explore it myself. But I think it may prove interesting for other people and perhaps spur some concrete actionable proposal. With the growing complexity of Python software stac

Re: [Python-ideas] More alternate constructors for builtin type

2019-05-06 Thread Antoine Pitrou
On Mon, 6 May 2019 19:39:39 +0300 Serge Matveenko wrote: > On Mon, May 6, 2019 at 7:29 PM Guido van Rossum wrote: > > > > On Mon, May 6, 2019 at 11:14 AM Serhiy Storchaka > > wrote: > >> I do not propose to change the current behavior. I propose to add new > >> named constructors. In most cas

Re: [Python-ideas] shutil.symlink to allow non-race replacement of existing link targets

2019-05-16 Thread Antoine Pitrou
On Thu, 16 May 2019 13:05:48 +0300 Serhiy Storchaka wrote: > 16.05.19 11:28, Barry Scott пише: > > To replace one symlink with another atomically is possible by using > > rename() or renameat() > > something like: > > > > os.symlink( src, tmp_symlink ) > > os.rename( tmp_symlink, dst )

Re: [Python-ideas] shutil.symlink to allow non-race replacement of existing link targets

2019-05-16 Thread Antoine Pitrou
On Thu, 16 May 2019 16:04:36 +0300 Serhiy Storchaka wrote: > 16.05.19 14:33, Antoine Pitrou пише: > > On Thu, 16 May 2019 13:05:48 +0300 > > Serhiy Storchaka > > wrote: > >> 16.05.19 11:28, Barry Scott пише: > >>> To replace one symlink wi

Re: [Python-ideas] shutil.symlink to allow non-race replacement of existing link targets

2019-05-16 Thread Antoine Pitrou
On Thu, 16 May 2019 18:05:39 +0300 Serhiy Storchaka wrote: > 16.05.19 17:05, Antoine Pitrou пише: > > On Thu, 16 May 2019 16:04:36 +0300 > > Serhiy Storchaka > > wrote: > >> 16.05.19 14:33, Antoine Pitrou пише: > >>> On Thu, 16 May 2019 13:05:48

[Python-ideas] Re: adding support for a "raw output" in JSON serializer

2019-08-15 Thread Antoine Pitrou
On Wed, 14 Aug 2019 04:21:05 +1000 Chris Angelico wrote: > > That's one of the reasons that a simple solution of "make JSONEncoder > respect decimal.Decimal" was rejected - it would require that the json > module import decimal, which is extremely costly. Having a __json__ > protocol would be les

[Python-ideas] Re: adding support for a "raw output" in JSON serializer

2019-08-27 Thread Antoine Pitrou
On Sun, 11 Aug 2019 20:09:41 -0400 David Shawley wrote: > On Aug 8, 2019, at 3:55 PM, Chris Angelico wrote: > > > > > There are two broad suggestions that came out of that thread and > > others, and I think it may be worth reopening them. > > > > 1) Should JSONEncoder (the class underlying jso

[Python-ideas] Re: adding support for a "raw output" in JSON serializer

2019-08-27 Thread Antoine Pitrou
On Tue, 27 Aug 2019 11:20:58 +0200 Richard Musil wrote: > > To resolve the bpo issue with numpy, one would need to implement complete > custom serialization (1) or simply convert numpy number types into Python > number types. Yes, both are possible and both could even be implemented. For Numpy

[Python-ideas] Re: adding support for a "raw output" in JSON serializer

2019-08-27 Thread Antoine Pitrou
On Tue, 27 Aug 2019 10:51:52 +0100 Paul Moore wrote: > > For example, the numpy case might be covered completely by the JSON > module just adding supporting for types that provide an __index__ > method. So rather than needing a new protocol, an existing one might > be perfectly adequate. (Althoug

[Python-ideas] Re: adding support for a "raw output" in JSON serializer

2019-08-27 Thread Antoine Pitrou
On Wed, 28 Aug 2019 03:03:00 +0900 "Stephen J. Turnbull" wrote: > Antoine Pitrou writes: > > > Here is a use case where it may remove some pain from users'life: > > https://bugs.python.org/issue24313 > > The problem is that a protocol like __json__

[Python-ideas] Re: adding support for a "raw output" in JSON serializer

2019-08-29 Thread Antoine Pitrou
On Thu, 29 Aug 2019 12:51:04 +0900 "Stephen J. Turnbull" wrote: > > If there's a protocol for > converting objects to JSON, people will expect it to work, pretty much > as much as __str__ does, at least in the domain that they're working > in. And frequently it won't, and the user will be surpri

[Python-ideas] Re: Add a `dig` method to dictionaries supporting the retrieval of nested keys

2019-09-04 Thread Antoine Pitrou
I recommend you take at look at the "toolz" library, which provides assorted APIs to help in data structure manipulation: https://toolz.readthedocs.io/en/latest/index.html Especially this function: https://toolz.readthedocs.io/en/latest/api.html#toolz.dicttoolz.get_in Regards Antoine. On Thu

[Python-ideas] Re: Automatic translation of Python to assembly language

2019-09-08 Thread Antoine Pitrou
How is your approach different from, say, Cython, Nuitka or Pythran? Regards Antoine. On Sun, 08 Sep 2019 15:56:04 - "Mark @pysoniq" wrote: > Hi, Anders, > > The availability of a free extension every 30 days is a big benefit to the > Python community that may not be immediately obviou

[Python-ideas] Re: Automatic translation of Python to assembly language

2019-09-08 Thread Antoine Pitrou
al product leaves a bad taste in my mouth. > But it's also not like there aren't already 5 or more open source projects > that do a similar thing better already. > > On Sun, Sep 8, 2019, 12:03 PM Antoine Pitrou > wrote: > > > > > How is your approac

[Python-ideas] Re: Automatic translation of Python to assembly language

2019-09-08 Thread Antoine Pitrou
With all due respect, your description sounds more like marketing than actual technical data. You should provide a detailed technical of your solution, otherwise this is off-topic on this mailing-list. Also, performance numbers without a detailed description of what's exactly measured (includin

[Python-ideas] Re: Automatic translation of Python to assembly language

2019-09-08 Thread Antoine Pitrou
On Sun, 08 Sep 2019 17:20:30 - "Mark @pysoniq" wrote: > Antoine, > > In response to your comment: "Finally, Cython does not require any > rewriting, and annotations are > optional." > > With Cython the end user does need to modify the code by inserting C type > definitions like this: No.

[Python-ideas] Re: Automatic translation of Python to assembly language

2019-09-08 Thread Antoine Pitrou
On Sun, 08 Sep 2019 17:27:27 - "Mark @pysoniq" wrote: > Antoine, > > In response to "You should provide a detailed technical of your solution." > > The automatically created ctypes wrapper is one of the keys of the project. > Blog entries 1 & 2 are a very detailed and technical discussion

[Python-ideas] Re: Automatic translation of Python to assembly language

2019-09-09 Thread Antoine Pitrou
On Sun, 08 Sep 2019 18:17:17 - "Mark @pysoniq" wrote: > Hi, David, > > In several other posts here, I have distinguished PysoniQ from the open > source projects mentioned. It has much better ease of use and faster > published metrics than the other projects mentioned. The faster metrics

[Python-ideas] Re: Automatic translation of Python to assembly language

2019-09-09 Thread Antoine Pitrou
On Mon, 9 Sep 2019 11:04:22 -0700 Christopher Barker wrote: > I'm surprised no one has mentioned Psyco yet -- probably because it evolved > into PyPy -- but IIRC, Psycho was pretty much the same as what the OP is > talking about -- direct Python to machine code, and easy on the fly or > ahead of

[Python-ideas] Re: Support for atomic types in Python

2019-09-10 Thread Antoine Pitrou
On Mon, 9 Sep 2019 19:04:35 +1000 Chris Angelico wrote: > On Mon, Sep 9, 2019 at 12:34 AM Vinay Sharma via Python-ideas > wrote: > > > > Currently, C++ has support for atomic types, on which operations like add, > > sub, xor, etc can be done atomically, thereby avoiding data races. > > Having su

[Python-ideas] Re: Support for atomic types in Python

2019-09-10 Thread Antoine Pitrou
Hi Vinay, On Mon, 09 Sep 2019 08:23:48 - Vinay Sharma via Python-ideas wrote: > > Also, as far as I know (might be wrong) Value is stored in shared memory and > is therefore very fast also. So, what I am proposing is a similar object to > value to which operations like add, sub, xor, etc

[Python-ideas] Re: Support for atomic types in Python

2019-09-10 Thread Antoine Pitrou
On Tue, 10 Sep 2019 18:59:55 +1000 Chris Angelico wrote: > On Tue, Sep 10, 2019 at 6:55 PM Antoine Pitrou wrote: > > > > On Mon, 9 Sep 2019 19:04:35 +1000 > > Chris Angelico wrote: > > > On Mon, Sep 9, 2019 at 12:34 AM Vinay Sharma via Python-ideas > > &

[Python-ideas] Re: Support for atomic types in Python

2019-09-13 Thread Antoine Pitrou
t to > prevent data races. Making this reference count variable atomic will prevent > passing locks with these variables. > > GIL helps in preventing this scenario in case of multithreading, but it very > well occurs in case of multiprocessing. Although, the type of shared resource

[Python-ideas] Re: Support for atomic types in Python

2019-09-13 Thread Antoine Pitrou
On Fri, 13 Sep 2019 10:27:10 -0700 Andrew Barnert via Python-ideas wrote: > > (If you want a shiny modern solution instead, this looks like one of the few > cases where hardware TM support can probably speed things up relatively > easily, which would be a fun project to work on…) Hardware tran

[Python-ideas] Re: RFC: PEP xxx: Python Compatibility Version

2019-10-22 Thread Antoine Pitrou
Hi, Just bear in mind that I have read only a couple sentences in the PEP. But as soon as you propose to offer only "partial compatibility" with a previous version, then I think it's worse than useless. You are introducing an additional Python version, i.e. "3.9 bended towards 3.8 partial compa

[Python-ideas] Re: Testing for NANs [was Re: Fix statistics.median()?]

2019-12-28 Thread Antoine Pitrou
On Sat, 28 Dec 2019 19:31:33 +1100 Chris Angelico wrote: > On Sat, Dec 28, 2019 at 7:03 PM Steve Barnes wrote: > > > > Personally I still like the fundamental: > > > > > > > > def is_nan(num): > > > > “”” Test for NaN “”” > > > > return num != num > > > > Which was in Steven's original

[Python-ideas] Re: Testing for NANs [was Re: Fix statistics.median()?]

2019-12-28 Thread Antoine Pitrou
On Fri, 27 Dec 2019 23:52:13 -0800 Christopher Barker wrote: > On Fri, Dec 27, 2019 at 5:39 PM Guido van Rossum wrote: > > > Is duck typing float or Decimal worth the bother? Barring that it could be > > done with some isinstance() checks (in the user code, not in math.isnan()). > > > > well,

[Python-ideas] Re: Pickle to/from filename or path

2020-02-07 Thread Antoine Pitrou
On Fri, 7 Feb 2020 13:03:52 -0500 Todd wrote: > Currently with pickle you have to "open" the file separately from the > pickle operation, generally using a "with" clause, then provide the file > object to one of the pickle.dump or pickle.load. This adds quite a bit of > boilerplate for simply sav

[Python-ideas] Re: pickle.reduce and deconstruct

2020-02-07 Thread Antoine Pitrou
I hadn't seen the original message (perhaps it fell through the GMane migration). I think this would indeed be a worthwhile addition to pickle. Is it possible to continue this discussion on python-dev? I don't think this is a PEP-level topic. Regards Antoine. On Fri, 7 Feb 2020 12:48:48 -0

[Python-ideas] Re: SerialExecutor for concurrent.futures + Convenience constructor

2020-02-16 Thread Antoine Pitrou
On Sat, 15 Feb 2020 14:16:39 -0800 Andrew Barnert via Python-ideas wrote: > > On Feb 15, 2020, at 13:36, Jonathan Crall wrote: > > > > Also, there is no duck-typed class that behaves like an executor, but does > > its processing in serial. Often times a develop will want to run a task in > > p

[Python-ideas] Re: SerialExecutor for concurrent.futures + Convenience constructor

2020-02-16 Thread Antoine Pitrou
On Sun, 16 Feb 2020 09:29:36 -0500 Kyle Stanley wrote: > > After Andrew explained his own use case for it with isolating bugs to > ensure that the issue wasn't occurring as a result of parallelism, threads, > processes, etc; I certainly can see how it would be useful. I could also > see a use cas

[Python-ideas] Re: SerialExecutor for concurrent.futures + Convenience constructor

2020-02-16 Thread Antoine Pitrou
On Sun, 16 Feb 2020 17:41:36 -0500 Kyle Stanley wrote: > > As a side note, are we still interested in expanding the public API for the > Future class? Particularly for a public means of accessing the state. The > primary motivation for it was this topic, but I could easily the same > issues comin

[Python-ideas] Re: SerialExecutor for concurrent.futures + Convenience constructor

2020-02-17 Thread Antoine Pitrou
On Sun, 16 Feb 2020 19:46:13 -0500 Kyle Stanley wrote: > > Based on the proposal in the OP, I had considered that it might also be > needed to be able to manually set the state of the future through something > like a `Future.set_state()`, which would have a parameter for accessing it > safely th

[Python-ideas] Re: SerialExecutor for concurrent.futures + Convenience constructor

2020-02-17 Thread Antoine Pitrou
On Mon, 17 Feb 2020 12:19:59 -0800 Guido van Rossum wrote: > It's actually really hard to implement your own Future class that works > well with concurrent.futures.as_completed() -- this is basically what > complicated the OP's implementation. Maybe it would be useful to look into > a protocol to

[Python-ideas] Re: Is this metaconversation helpful?

2020-02-24 Thread Antoine Pitrou
On Mon, 24 Feb 2020 09:16:12 -0800 Christopher Barker wrote: > This is an honest question: > > Is it helpful to anyone taking part in this conversation about the > conversation to have it? > > I don’t think it’s helpful to the list as a whole, honestly. Agreed. Especially as it seems to be reh

[Python-ideas] Re: Non-blocking concurrent.futures ThreadPoolExecutor

2020-03-10 Thread Antoine Pitrou
On Tue, 10 Mar 2020 15:16:06 +0100 Remy NOEL wrote: > On Mon, Mar 9, 2020 at 11:18 PM Kyle Stanley wrote: > > > We're currently looking into adjusting the current Executor implementation > > (for both TPE and PPE) to not use daemon threads at all for subinterpreter > > compatibility, see https:/

[Python-ideas] Re: PEP 9999: Retire animal-unfriendly language

2020-03-31 Thread Antoine Pitrou
Your search is incomplete, for example you failed to account for occurrences of "cheese" and "milkshake". Regards Antoine. On Tue, 31 Mar 2020 19:17:18 +0200 Gerrit Holl wrote: > (needs a sponsor) > > latest version at > https://github.com/gerritholl/peps/blob/animal-friendly/pep-.rst >

[Python-ideas] Re: PEP 9999: Retire animal-unfriendly language

2020-04-01 Thread Antoine Pitrou
On Wed, 1 Apr 2020 10:20:39 -0700 Andrew Barnert via Python-ideas wrote: > On Mar 31, 2020, at 20:03, Greg Ewing wrote: > > > > On 1/04/20 7:08 am, Serhiy Storchaka wrote: > >> 31.03.20 20:52, Antoine Pitrou пише: > >>> Your search is incomplete, f

[Python-ideas] Re: Live variable analysis -> earlier release?

2020-04-08 Thread Antoine Pitrou
On Wed, 8 Apr 2020 09:53:41 -0700 Guido van Rossum wrote: > Look at the following code. > > def foo(a, b): > x = a + b > if not x: > return None > sleep(1) # A calculation that does not use x > return a*b > > This code DECREFs x when the frame is exited (at the return st

[Python-ideas] Re: Live variable analysis -> earlier release?

2020-04-08 Thread Antoine Pitrou
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 that in the development of asyncio there were a few places where > we

  1   2   3   >