[Python-ideas] Re: foo.setParseAction(lambda a, b, c: raise FuckPython(":("))

2019-10-28 Thread Andrew Barnert via Python-ideas
On Oct 28, 2019, at 14:23, Serhiy Storchaka wrote: > > 28.10.19 20:38, Andrew Barnert via Python-ideas пише: >> Many of them are abusing throw(StopIteration) to fake a “takewhile clause” >> in comprehensions > > Well, so actually you needed the break expression. Or multistatement >

[Python-ideas] Re: foo.setParseAction(lambda a, b, c: raise FuckPython(":("))

2019-10-28 Thread Serhiy Storchaka
28.10.19 20:38, Andrew Barnert via Python-ideas пише: Many of them are abusing throw(StopIteration) to fake a “takewhile clause” in comprehensions Well, so actually you needed the break expression. Or multistatement comprehension. ___ Python-ideas

[Python-ideas] Re: Ability to specify function for auto-test in Enum and pass the given value as an argument to _generate_next_value_

2019-10-28 Thread Steve Jorgensen
Steve Jorgensen wrote: > I repeatedly make proposals without examples. Sorry about that, and I'm going > to stop > doing that. > Upon trying to compose an example, I realize that what I'm asking for is not > actually > the best pattern for what I'd like to see, so when I have composed a better

[Python-ideas] Re: foo.setParseAction(lambda a, b, c: raise FuckPython(":("))

2019-10-28 Thread Andrew Barnert via Python-ideas
On Oct 27, 2019, at 17:27, Chris Angelico wrote: > > and the fact that > throw() isn't in everyone's toolkits already suggests that this really > isn't a major problem to be solved. Searching on “python raise expression”, the first hit is a StackOverflow question where the asker is looking for

[Python-ideas] Re: foo.setParseAction(lambda a, b, c: raise FuckPython(":("))

2019-10-28 Thread Brett Cannon
On Sun, Oct 27, 2019 at 6:58 AM Soni L. wrote: > foo.setParseAction(lambda a, b, c: raise FuckPython(":(")) is invalid > syntax, which makes pyparsing useless. > Insulting the project that you're trying to get help with is unnecessary to get your point across. Consider this a warning that such

[Python-ideas] Re: Suggestion for behaviour change import mechanics

2019-10-28 Thread Andrew Barnert via Python-ideas
On Oct 28, 2019, at 04:44, Richard Vogel wrote: > > Current state: > Python will search for the first TOP-LEVEL hit when resolving an import > statement and search inside there for the remainder part of the import. If it > cannot find the symbols it will fail. (Tested on Python 3.8) >

[Python-ideas] Re: Suggestion for behaviour change import mechanics

2019-10-28 Thread Steven D'Aprano
Hi Richard, and welcome! My comments are below, interspersed with your comments, which are prefixed with ">". On Mon, Oct 28, 2019 at 12:44:32PM +0100, Richard Vogel wrote: [...] > Current state: > > * Python will search for the first TOP-LEVEL hit when resolving an >import statement and

[Python-ideas] Suggestion for behaviour change import mechanics

2019-10-28 Thread Richard Vogel
Hello everyone, I hope that E-Mail reaches someone. Since its the first time I am using a thing like a mailing list, I am saying sorry in advance for any inconvience caused ;-) However, I am writing you because of a small idea / feature request for the python import mechanism, which caused me

[Python-ideas] Re: Python 4000: Have stringlike objects provide sequence views rather than being sequences

2019-10-28 Thread Steven D'Aprano
I think that we're more or less in broad agreement, but I wanted to comment on this: On Sun, Oct 27, 2019 at 09:41:00PM -0700, Andrew Barnert wrote: > Yes, that’s the whole point of the message you were responding to: > extended grapheme clusters are the Unicode approximation of > characters;

[Python-ideas] Re: Ability to customize how Enum interprets values with access to names

2019-10-28 Thread Steve Jorgensen
Anders Hovmöller wrote: > I do agree that this is a worthwhile feature-ish, but it's marred by the > tuples-for-values assumption. We've build very much the same thing in > tri.token (https://github.com/TriOptima/tri.token) > but tri.token is much more scalable to many arguments because it uses

[Python-ideas] Re: Ability to customize how Enum interprets values with access to names

2019-10-28 Thread Anders Hovmöller
I do agree that this is a worthwhile feature-ish, but it's marred by the tuples-for-values assumption. We've build very much the same thing in tri.token (https://github.com/TriOptima/tri.token) but tri.token is much more scalable to many arguments because it uses keyword arguments and not