Re: [Python-ideas] "Immutable Builder" Pattern and Operator

2017-01-23 Thread Alexandre Brault
On 2017-01-23 12:54 PM, Soni L. wrote: > On 23/01/17 02:56 PM, Gerald Britton wrote: >> On Jan 23, 2017 11:07 AM, "Soni L." > > wrote: >> >> On 23/01/17 01:52 PM, Gerald Britton wrote: >>> >>> [snip] >>> >>> >>> >>>

Re: [Python-ideas] PEP 8 coding style included in grammar ?

2017-03-01 Thread Alexandre Brault
Long story short, it's because there can be good reasons to ignore PEP8 naming conventions. Linting tools can be taught to skip over an intentional PEP8 violation. A grammar rule can't Alex On 2017-03-01 09:04 AM, Mathieu BEAL wrote: > > I was wondering why the PEP coding style >

Re: [Python-ideas] PEP: Distributing a Subset of the Standard Library

2016-11-28 Thread Alexandre Brault
I would also prefer (2) for exactly the example given in this thread. The Windows version of curses.missing.py could raise a ModuleNotFoundError saying that curses is not available on Windows, but a developer who wants to can install PDCurses to implement the stdlib module. I don't think the few

Re: [Python-ideas] Non-ASCII in Python syntax? [was: Null coalescing operator]

2016-10-30 Thread Alexandre Brault
On 2016-10-30 10:47 AM, Paul Moore wrote: On 30 October 2016 at 14:43, wrote: Just picking a nit, here, windows will happily let you do silly things like hook 14 keyboards up and let you map all of emoji to them. Sadly, this requires lua. Off topic, I know, but

Re: [Python-ideas] For/in/as syntax

2017-03-03 Thread Alexandre Brault
On 2017-03-03 01:52 PM, Chris Angelico wrote: > On Sat, Mar 4, 2017 at 5:50 AM, Matthias Bussonnier > wrote: >> Thanks, I think it does make sens, I'm going to guess, >> outerloop.brk(inners=True) might also be helpful if you have more >> inners loops. I think that

Re: [Python-ideas] namedtuple literals [Was: RE a new namedtuple]

2017-07-26 Thread Alexandre Brault
On 2017-07-26 01:10 PM, Steven D'Aprano wrote: > On Thu, Jul 27, 2017 at 02:05:47AM +1000, Nick Coghlan wrote: >> On 26 July 2017 at 11:05, Steven D'Aprano wrote: >>> I don't see any way that this proposal can be anything by a subtle >>> source of bugs. We have two

Re: [Python-ideas] Add an option for delimiters in bytes.hex()

2017-05-01 Thread Alexandre Brault
On 2017-05-01 01:41 PM, Alexandre Brault wrote: > On 2017-05-01 01:34 PM, Ethan Furman wrote: >> On 05/01/2017 07:04 AM, Juancarlo Añez wrote: >>> On Mon, May 1, 2017 at 9:38 AM, Nick Coghlan wrote: >>> >>>> just support two >>>> keyw

Re: [Python-ideas] Add an option for delimiters in bytes.hex()

2017-05-01 Thread Alexandre Brault
On 2017-05-01 01:34 PM, Ethan Furman wrote: > On 05/01/2017 07:04 AM, Juancarlo Añez wrote: >> On Mon, May 1, 2017 at 9:38 AM, Nick Coghlan wrote: >> >>> just support two >>> keyword arguments to hex(): "delimiter" (as you suggest) and >>> "chunk_size" (defaulting to 1, so you get per-byte

Re: [Python-ideas] Syntax idea: escaping names to avoid keyword ambiguity

2018-05-14 Thread Alexandre Brault
On 2018-05-14 06:47 AM, Daniel Moisset wrote: > Following up some of the discussions about the problems of adding > keywords and Guido's proposal of making tokenization > context-dependent, I wanted to propose an alternate way to go around > the problem. > > My proposal essentially boils down to:

Re: [Python-ideas] Verbatim names (allowing keywords as names)

2018-05-18 Thread Alexandre Brault
On 2018-05-17 11:02 PM, Neil Girdhar wrote: For that reason, I'd like to make a more modest proposal to *only* add a verbatim versions of keywords as necessary, e.g., "\where" or "\given".  That way, there will be no temptation to use that syntax in any other place.  If a new version of

Re: [Python-ideas] Verbatim names (allowing keywords as names)

2018-05-17 Thread Alexandre Brault
On 2018-05-17 2:03 AM, Greg Ewing wrote: Steven D'Aprano wrote: Let's say you're reading from a CSV file, creating an object from each row, and processing it: Okay, I can see it could be useful for situations like that. But this is still a completely different use case from the one that

Re: [Python-ideas] Alternative spelling for list.append()

2018-06-17 Thread Alexandre Brault
On 2018-06-17 7:36 PM, Clint Hepner wrote: On Jun 17, 2018, at 4:18 PM, Chris Angelico wrote: On Mon, Jun 18, 2018 at 3:01 AM, Mikhail V wrote: The idea is to introduce new syntax for the list.append() method. Syntax: Variant 1. Use special case of index, namely omitted index:

Re: [Python-ideas] PEP 505: None-aware operators: operators ?= and ?? and OR

2018-08-02 Thread Alexandre Brault
On 2018-08-02 7:01 PM, Eric Fahlgren wrote: On Thu, Aug 2, 2018 at 3:39 PM MRAB > wrote: In the relevant code, is policy.mangle_from_ ever None? That's impossible to know, since the initializer where this code originally appears puts no constraints on

Re: [Python-ideas] Does jargon make learning more difficult?

2018-08-15 Thread Alexandre Brault
On 2018-08-15 03:32 PM, MRAB wrote: > On 2018-08-15 18:27, MRAB wrote: >> On 2018-08-15 09:17, Jonathan Fine wrote: >>> Steve Barnes and Greg Ewing wrote: >>> >   * A dinosaur is specifically an extinct terrible (formerly > considered) > lizard Which technically is not

Re: [Python-ideas] string method count()

2018-04-25 Thread Alexandre Brault
str.count counts non-overlapping instances of the substring. After counting the first 'AA', there is only one A left, so that isn't a second instance of 'AA' On 2018-04-25 02:22 PM, Julia Kim wrote: > Hi, > > There’s an error with the string method count(). > > x = ‘AAA’ > y = ‘AA’ >

[Python-ideas] Re: Python should take a lesson from APL: Walrus operator not needed

2019-11-06 Thread Alexandre Brault
On 2019-11-06 12:05 p.m., Martin Euredjian via Python-ideas wrote: Typing these symbols isn't a problem at all.  For example, in NARS2000, a free APL interpreter I use, the assignment operator "←" is entered simply with "Alt + [".  It takes seconds to internalize this and never think about

[Python-ideas] Re: PEP 472 - new dunder attribute, to influence item access

2020-08-26 Thread Alexandre Brault
On 2020-08-27 12:33 a.m., Ricky Teachey wrote: On Wed, Aug 26, 2020 at 10:34 PM Steven D'Aprano > wrote: On Wed, Aug 26, 2020 at 12:32:56PM -0400, Ricky Teachey wrote: > It creates a language supported way for the creator of the class to decide > how

[Python-ideas] Re: [Feature] Body closure

2020-07-13 Thread Alexandre Brault
On 2020-07-13 5:12 p.m., Joao S. O. Bueno wrote: You know you can simply pass functions as parameters, right? def lock(func, *args):    # ...setup    result = func(*args)    #... teardown   return result. And then, with 3 more lines you do a decorator out of that def locked(func):     #

[Python-ideas] Re: Using explicit parenthesization to convey aspects of semantic meaning?

2020-12-17 Thread Alexandre Brault
ays of discussion, literally nobody came to the same conclusion that you did, then it's obvious that the while path, each step on it, and the final answer are NOT as unavoidable as you imagine them to be. I think we can consider this case closed Alexandre Brault _

[Python-ideas] Re: Reverse polish notation

2021-04-03 Thread Alexandre Brault
On 2021-04-03 12:07 a.m., John wrote: The fundamental point I made up front was that reading the stuff back and auditing it is much more difficult with complex equations in algebraic notation than in postfix. Writing equations is only difficult as a side effect of it being difficult to keep

[Python-ideas] Re: `is in`/`not is in` operators

2021-10-29 Thread Alexandre Brault
On 2021-10-25 5:32 a.m., Jeremiah Vivian wrote: For quick checking if a `Movement` object is inside of an iterable. It seems the core of your problem is that you took the mechanism that's supposed to tell you if two objects are identical for another purpose, and now are complaining that you

[Python-ideas] Re: Custom literals, a la C++

2022-04-04 Thread Alexandre Brault
On 2022-04-05 12:17 a.m., Chris Angelico wrote: On Tue, 5 Apr 2022 at 13:00, Steven D'Aprano wrote: Sure, we can demand that every application that needs to deal with US survey miles and imperial miles and international miles give them all distinct names. That's one solution, but not the

[Python-ideas] Re: Allowing non-ASCII bracket and quote characters in source code

2022-01-19 Thread Alexandre Brault
On 2022-01-18 6:12 p.m., Chris Angelico wrote: 3) Optional semantic difference: 【1, 2, 3】 is exactly the same as (1, 2, 3), but 【1, 2, 3) would be an error. What does it say about the viability of this idea that until the second part of that sentence, I thought it would be equivalent to [1,

[Python-ideas] Re: Allowing `str.format` to format one or more parameters instead of all parameters

2023-04-26 Thread Alexandre Brault
On 2023-04-26 11:03 a.m., MRAB wrote: On 2023-04-26 02:16, Joao S. O. Bueno wrote: On Sat, Apr 22, 2023 at 10:06 AM Damian Cross > wrote:     That would have the effect that every use of str.format for everyone     would start producing partially-formatted strings