[Python-ideas] Re: Nonuniform PRNG?

2022-12-07 Thread Eric Fahlgren
I suspect you wouldn't have to test it all, as it would simply be a trivial redistribution of a standard (already known-good) generator: def random_bit_666(): return int(random() > 2/3) For other more sophisticated distributions, again simply verify that your distribution algorithm is

[Python-ideas] Re: zip(x, y, z, strict=True)

2022-12-01 Thread Eric Fahlgren
I liked your idea so much back when you suggested it that I implemented it in our sitecustomize.py back when we were using 3.8, and added a check to our lint tools to require that the 'strict=' parameter be present in all uses of 'zip'. We found a couple of silent bugs almost immediately, so

[Python-ideas] Re: Python array multiplication for negative values should throw an error

2022-05-31 Thread Eric Fahlgren
On Tue, May 31, 2022 at 5:54 AM fjwillemsen--- via Python-ideas < python-ideas@python.org> wrote: > I can not think of good reasons why Python array multiplication should not > throw an error for negative multipliers, because it is meaningless to have > array multiplication by negative value in

[Python-ideas] Re: mro and super don't feel so pythonic

2022-04-05 Thread Eric Fahlgren
On Tue, Apr 5, 2022 at 7:49 AM Greg Ewing wrote: > > It's only there now for backwards compatibility. It's not > Not always. I have an example, where a method creates a closure that calls super, requiring the class/self pair as there isn't enough context for parameterless super. (And also in

[Python-ideas] Re: Config file template motivation for PEP 463 or an update to format string spec

2022-04-01 Thread Eric Fahlgren
My first thought was that this is a job for string.Template, which has always struck me as subclassing-friendly. Took about a half hour of wrangling the regex to get here: from string import Template, _sentinel_dict class TemplateWithDefaults(Template): braceidpattern =

[Python-ideas] Re: Expand type coverage in cpython implementation

2022-03-16 Thread Eric Fahlgren
Most importantly, static type checking is still immature and as yet there is no standard for how to say "this thing is an X". Adding type hints into the stdlib source would force you to choose one (third party) tool, https://typing.readthedocs.io/en/latest/#type-checkers , which then would lock

[Python-ideas] Re: repeat until

2022-03-01 Thread Eric Fahlgren
As you probably suspect, yes, it comes up every couple of years. Here's one of the recent threads (there are more, just search for 'until' in the archives), that might give you some ideas for how this discussion will progress. :)

[Python-ideas] Re: Missing expandvars equivalent in pathlib

2022-02-13 Thread Eric Fahlgren
On Sun, 13 Feb 2022 at 15:43, Chris Angelico wrote: > > it to. If I'm on Windows and I tell something to write to a file in > > "%TEMP%\spam.csv", then I expect it to understand what that means. > > Cross-platform support is nice, but the most common need is for the > > current platform's normal

[Python-ideas] Re: Please consider mentioning property without setter when an attribute can't be set

2022-02-11 Thread Eric Fahlgren
Yeah, I have to agree with Neil. I had exactly this issue a couple years ago, and it took me an hour or two to figure out that it was a property/descriptor-protocol causing the issue, at which point the fix became trivial. Just knowing to think "it's a property, stupid!" was the hard part and

[Python-ideas] Re: Fwd: Simple curl/wget-like download functionality in urllib (like http offers server)

2021-10-19 Thread Eric Fahlgren
On Tue, Oct 19, 2021 at 12:31 AM Tom Pohl wrote: > I am aware of requests (or httpx, ...), but the idea is to do all that > with the > standard library. If I have to install stuff, I could just install > wget/curl and be done. > I believe what you are looking for is already in the stdlib, see

[Python-ideas] Re: dict_items.__getitem__?

2021-10-12 Thread Eric Fahlgren
On Mon, Oct 11, 2021 at 8:08 PM Steven D'Aprano wrote: > I assume you're not just extracting the first value for the LOLs, you > must have some reason for it. It is *that reason* which counts as a > use-case. > I dug through our application code base (500k lines) and found just one use case of

[Python-ideas] Re: Shorthand syntax for lambda functions that have a single parameter

2021-10-03 Thread Eric Fahlgren
I'm somewhat confused by the term "last item of the set", as sets are not ordered and have no "last" element: >>> {1,3,3,2} {1, 2, 3} On Sat, Oct 2, 2021 at 8:23 PM Abdulla Al Kathiri < alkathiri.abdu...@gmail.com> wrote: > Then use it with the normal expression lambda: > people.sort(key=p =>

[Python-ideas] Re: os.workdir() context manager

2021-09-15 Thread Eric Fahlgren
On Wed, Sep 15, 2021 at 12:21 AM Eric V. Smith wrote: > And I'm not crazy about the name "workdir". To me, it sounds like it > returns something, not sets and resets something. But I don't have a > particularly great alternative in mind: in my own code I've used > "change_dir", which isn't

[Python-ideas] Re: Circular Indexing

2020-11-25 Thread Eric Fahlgren
On Wed, Nov 25, 2020 at 3:44 PM Steven D'Aprano wrote: > Obviously you can tell the two apart, so I'm confused by your comment. > What I imagined while reading Greg's comment was trying to explain to a student why this didn't work the way they expected. "Ok, so in the first case I'm *not*

[Python-ideas] Re: raise TypeError when giving wrong type of argument in functions

2020-08-22 Thread Eric Fahlgren
On Sat, Aug 22, 2020 at 7:37 AM wrote: > No. I wanted to know if they can add this suggestion in next versions > That will not happen. You may want to familiarize yourself with the intent of type annotations: https://www.python.org/dev/peps/pep-0526/#non-goals

[Python-ideas] Re: Add builtin function for min(max())

2020-07-09 Thread Eric Fahlgren
Yeah, but "not a number of pounds" sure beats seeing "£inf". On Thu, Jul 9, 2020 at 3:25 AM Jonathan Fine wrote: > Off topic: I saw this NaN article this morning. > > Title: Hungry? Please enjoy this delicious NaN, courtesy of British Gas > and Sainsbury's > URL:

[Python-ideas] Re: PEP 618: Add Optional Length-Checking To zip

2020-05-06 Thread Eric Fahlgren
On Wed, May 6, 2020 at 6:27 PM David Mertz wrote: > I don't think being a function versus a classmethod is important here. > Just that the underlying name is *callable*. > But wait a minute, zip isn't just a "callable", it's a class, and adding more methods to it seems perfectly natural, just

[Python-ideas] Re: Adding a "once" function to functools

2020-04-26 Thread Eric Fahlgren
On Sun, Apr 26, 2020 at 9:46 AM Alex Hall wrote: > It's not clear to me why people prefer an extra function which would be > exactly equivalent to lru_cache in the expected use case (i.e. decorating a > function without arguments). It seems like a good way to cause confusion, > especially for

[Python-ideas] Re: zip(x, y, z, strict=True)

2020-04-23 Thread Eric Fahlgren
On Wed, Apr 22, 2020 at 12:23 PM David Mertz wrote: > On Wed, Apr 22, 2020, 4:24 AM Antoine Pitrou > >> But, as far as I'm concerned, the number of times where I took >> advantage of zip()'s current acceptance of heteregenously-sized inputs >> is extremely small. In most of my uses of zip(), a

[Python-ideas] Re: Range of Indexes

2020-04-11 Thread Eric Fahlgren
On Sat, Apr 11, 2020 at 4:21 AM Rhodri James wrote: > Since the introduction of enumerate() lo! these many moons ago, I find I > almost never write range(len(x)) as a loop iterable. > Out of curiosity, I just grepped about 300k lines of source: 234 - enumerate() in for loops 140 - zip() in for

[Python-ideas] Re: RFC: For Loop Invariants

2020-04-10 Thread Eric Fahlgren
On Fri, Apr 10, 2020 at 2:56 PM Serhiy Storchaka wrote: > Don't listen to anyone. There is only one obvious way to write this in > one line: > > count = +(lambda *a: a[0](*a))((lambda q, r, s, i: r(r, q, s, i, next(i, > s))), (lambda r, q, s, i, x: x is not s and (x in seek) + q(q, r, s, > i)),

[Python-ideas] Re: Exception for parameter errors

2020-03-04 Thread Eric Fahlgren
On Wed, Mar 4, 2020 at 2:58 AM Steven D'Aprano wrote: > I don't know enough about the Python internals to give a definitive > answer, but I'm assuming/hoping that there is a single, or at most a > few, places in the interpreter that matches up arguments to formal > parameters, and if there's a

[Python-ideas] Re: Meta: ideas for Python [-ideas]

2020-02-23 Thread Eric Fahlgren
I had just started to play with Andrew's code on Friday, but got distracted by real work and had to drop it. This gets me further into the parts I wanted to play with, so big thanks! On Sun, Feb 23, 2020 at 5:45 AM André Roberge wrote: > (Apologies if this appears twice: I attempted to create

[Python-ideas] Re: Argumenting in favor of first()

2019-12-27 Thread Eric Fahlgren
On Thu, Dec 26, 2019 at 7:58 PM Marco Sulla via Python-ideas < python-ideas@python.org> wrote: > > So 200 posts for one line less? I really don't catch the point. > You apparently did not read the posts, because the point was whether it raises or returns a default value, not whether it saves one

[Python-ideas] Re: Suggestion for language addition

2019-12-05 Thread Eric Fahlgren
My little experiments in 3.7 show exception setup is about 40% more costly than just a do-nothing loop, but execution of is about 9x more expensive than doing nothing, so actually very little cost if your loop only rarely catches the exception (I assume you'll probably actually do something inside

[Python-ideas] Re: Using 'with' with extra brackets for nicer indentation

2019-11-13 Thread Eric Fahlgren
On Wed, Nov 13, 2019 at 2:09 PM Sebastian Kreft wrote: > What Eric Fahlgren wants is basically the deprecated contextlib.nested > function, that function should have the right semantics. See > https://github.com/python/cpython/blob/2.7/Lib/contextlib.py#L88-L129 > Oh, no, I don't wa

[Python-ideas] Re: Using 'with' with extra brackets for nicer indentation

2019-11-13 Thread Eric Fahlgren
On Wed, Nov 13, 2019 at 11:26 AM MRAB wrote: > "with" expression ["as" name] ":" > > but the expression itself can start with a parenthesis, so if it saw a > parenthesis after the "with" it would be ambiguous > I have used 'with' for so long that I was under the impression that the

[Python-ideas] Re: for ... except, with ... except

2019-07-29 Thread Eric Fahlgren
On Mon, Jul 29, 2019 at 2:58 PM Guido van Rossum wrote: > I am *guessing* the problem here is something like this: > > with open(filename) as f: > data = f.read() > > raises an exception if the open() call fails, but putting try... except > IOError: ... around the whole thing also catches

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

2019-04-01 Thread Eric Fahlgren
On Mon, Apr 1, 2019 at 7:50 AM Antoine Pitrou wrote: > > And 01 / 04 / 2019 should return a April 1st datetime. > > (except in the US, of course) > Where it would of course be I / / MMXV, unless you have ISO-8601 set in which case it would be MMXV - - I

Re: [Python-ideas] True and False are singletons

2019-03-18 Thread Eric Fahlgren
On Mon, Mar 18, 2019 at 7:04 AM Rhodri James wrote: > On 18/03/2019 12:19, Richard Damon wrote: > > On 3/18/19 7:27 AM, Greg Ewing wrote: > >> Juancarlo Añez wrote: > >> > >>> if settings[MY_KEY] is True: > >>> ... > >> > >> If I saw code like this, it would take a really good

Re: [Python-ideas] Consistency in naming [was Re: ...ALL CAPS]

2019-02-03 Thread Eric Fahlgren
On Sun, Feb 3, 2019 at 7:57 AM James Lu wrote: > > This kind of readability issue, datetime.now, is an example of what’s > contributing to Python’s decline. > Python's decline??? https://pypl.github.io/PYPL.html ___ Python-ideas mailing list

Re: [Python-ideas] Proposing additions to the standard library

2018-11-12 Thread Eric Fahlgren
My intuition has always been that the recipes, taking 'flatten' as an excellent example, solve problems in a specific way that is not generally considered to be the "right" way. For example, should 'flatten' perform one-level flattening or deep recursive flattening? Should it handle strings as

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

2018-10-31 Thread Eric Fahlgren
On Wed, Oct 31, 2018 at 2:42 AM Chris Angelico wrote: > > https://www.python.org/dev/peps/pep-0463/ wants to say hi. > > That was exactly my reaction, too, and usually is whenever one of these "add a default" or similar ideas pops up. 463 should be re-examined, I was very hopeful when it went

Re: [Python-ideas] Introduce typing.SupportsFsPath

2018-10-11 Thread Eric Fahlgren
Done https://github.com/python/mypy/issues/5775 On Thu, Oct 11, 2018 at 1:47 PM Ivan Levkivskyi wrote: > On Tue, 9 Oct 2018 at 15:17, Eric Fahlgren wrote: > >> On Tue, Oct 9, 2018 at 3:16 AM Ivan Levkivskyi >> wrote: >> >>> class PathLike(Protocol[AnySt

Re: [Python-ideas] Introduce typing.SupportsFsPath

2018-10-09 Thread Eric Fahlgren
On Tue, Oct 9, 2018 at 3:16 AM Ivan Levkivskyi wrote: > class PathLike(Protocol[AnyStr]): > I had been working on this same problem intermittently for several months, so thanks, but... error: Invariant type variable 'AnyStr' used in protocol where covariant one is expected is called out

Re: [Python-ideas] Jump to function as an an alternative to call function

2018-08-15 Thread Eric Fahlgren
How about just https://homepages.cwi.nl/~storm/teaching/reader/Dijkstra68.pdf On Wed, Aug 15, 2018 at 5:38 PM David Mertz wrote: > Hmm.. link broke. Is this right? > > >

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

2018-08-03 Thread Eric Fahlgren
On Fri, Aug 3, 2018 at 6:19 PM Steven D'Aprano wrote: > It needs some work. Something like "Here's an example in the standard > library. On converting it to none-aware version, we realised the std lib > version is buggy, because ...". A couple of sentences. > Yup, that's what I was getting

Re: [Python-ideas] With expressions

2018-08-03 Thread Eric Fahlgren
On Fri, Aug 3, 2018 at 5:26 PM Abe Dillon wrote: > One last thing: > > Since expressions tend to have pretty limited space, it might be worth it > to consider more concise options like maybe instead of: > > except (Exception[-list])[ as e]): > You're reinventing PEP 463:

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

2018-08-03 Thread Eric Fahlgren
On Thu, Aug 2, 2018 at 10:06 PM Alexandre Brault wrote: > I would make the opposite argument and claim that since when policy is > None mangle_from_ is initialised to True and not None, None is likely not a > potential value for policy.mangle_from_. Looking at > Lib/email/_policybase.py where

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

2018-08-02 Thread Eric Fahlgren
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 the value of 'policy', it's just assumed to have a 'mangle_from_' member... I would

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

2018-08-02 Thread Eric Fahlgren
On Thu, Aug 2, 2018 at 1:22 PM MRAB wrote: > > policy?.mangle_from_ ?? True > > True (??? since lhs is None?) > > > No, it's not 'policy.mangle_from_' that could be None, it's 'policy' > that could be None (i.e. there's no policy). > In my example, there is a policy, and the value of

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

2018-08-02 Thread Eric Fahlgren
>From the PEP: > >From email/generator.py (and importantly note that there is no way to substitute or for ?? in this situation): > mangle_from_ = True if policy is None else policy.mangle_from_ > After updating: > mangle_from_ = policy?.mangle_from_ ?? True I cannot see how these are equivalent,

Re: [Python-ideas] Revisiting str.rreplace()

2018-07-19 Thread Eric Fahlgren
On Thu, Jul 19, 2018 at 7:01 AM Calvin Spealman wrote: > As an alternative suggestion: What if the count parameter to str.replace() > counted from the right with negative values? That would be consistent with > other things like indexing and slicing. > ​That could certainly be made to work, but

Re: [Python-ideas] Performance improvements via static typing

2018-07-19 Thread Eric Fahlgren
On Thu, Jul 19, 2018 at 6:52 AM Michael Hall wrote: > While I am aware of projects like Cython and mypy, it seems to make sense > for CPython to allow optional enforcement of type hints, with compiler > optimizations related to it to be used. While this would not receive the > same level of

Re: [Python-ideas] Revisiting str.rreplace()

2018-07-19 Thread Eric Fahlgren
On Wed, Jul 18, 2018 at 8:20 PM Graham Gott wrote: > > Thoughts? Support/oppose? > ​ +1, along with an overall rework of str methods to make them more consistent. The find, replace and split families should all gain the same tuple-as-search-string that endswith and startswith use. (Discussed

Re: [Python-ideas] list configuration

2018-06-28 Thread Eric Fahlgren
I've been getting those, too, but from the wxPython-dev group. I concur that they look like googlegroups bounces (although I can't confirm that as I've been deleting them without much inspection). On Thu, Jun 28, 2018 at 9:35 AM Chris Barker via Python-ideas < python-ideas@python.org> wrote: >

Re: [Python-ideas] Check type hints in stack trace printing

2018-06-14 Thread Eric Fahlgren
On Thu, Jun 14, 2018 at 4:03 AM Daniel Sánchez Fábregas wrote: > My idea consist in: > Adding a method to perform type checking in traceback objects > When printing stack traces search for mistyped arguments and warn about > them to the user. > ​ Isn't it faster and far more reliable to run your

Re: [Python-ideas] Give regex operations more sugar

2018-06-13 Thread Eric Fahlgren
On Wed, Jun 13, 2018 at 3:54 PM MRAB wrote: > Would it check first-to-last or longest-to-shortest? I think that > longest-to-shortest would be the most useful. > > >>> old = ('cat', 'cats') > >>> new = ('mouse', 'mice') > >>> > >>> # First-to-last. > >>> 'cats'.replace(old, new) > 'mouses'

Re: [Python-ideas] exception instantiation philosophy and practice [was: Let try-except check the exception instance]

2018-06-01 Thread Eric Fahlgren
On Thu, May 31, 2018 at 10:55 PM Greg Ewing wrote: > Ethan Furman wrote: > > > Why is this? Doesn't the exception have to be instantiated at some > > point, even if just to print to stderr? > > If it gets caught by an except clause without an else clause, > in theory there's no need to

Re: [Python-ideas] shutil zero-copy and exotic filesystems

2018-05-29 Thread Eric Fahlgren
On Tue, May 29, 2018 at 10:17 AM Barry Scott wrote: > On Tuesday, 29 May 2018 16:42:13 BST Eric Fahlgren wrote: > > Maybe you are suffering from TCP windows scaling not work well enough? > Thanks for the tip, I'll have to mention that to our IT infrastructure guys and see if th

Re: [Python-ideas] shutil zero-copy and exotic filesystems

2018-05-29 Thread Eric Fahlgren
I have been doing speed testing on our network frequently enough over the last five year that I have a good feel for these changes. I have been benchmarking various means for copying files of 1.0-500 MB between workstations on our 1 Gbps LAN to local servers, and on our WAN which was just

Re: [Python-ideas] __dir__ in which folder is this py file

2018-05-16 Thread Eric Fahlgren
On Tue, May 15, 2018 at 10:11 PM Rob Speer wrote: > From what I can tell, if you wanted to exclude '__init__.py' from Nginx in > particular, you would have to write an unconventional Nginx configuration, > where you determine whether a path refers to a static file according

Re: [Python-ideas] Please consider skipping hidden directories in os.walk, os.fwalk, etc.

2018-05-08 Thread Eric Fahlgren
On Tue, May 8, 2018 at 2:31 AM, Oleg Broytman wrote: >So anyone who wants to filter os.walk() must reimplement os.walk() > themselves instead of passing something like filter_dir and filter_file > (or accept_dir/accept_file) to os.walk()? Kind of painful, no? > ​Not really.

Re: [Python-ideas] __dir__ in which folder is this py file

2018-05-07 Thread Eric Fahlgren
On Sun, May 6, 2018 at 9:30 PM, Mike Miller wrote: > On 2018-05-06 19:13, Nick Coghlan wrote: > >> Specifically, the ones I'd have in mind would be: >> >> - dirname (aka os.path.dirname) >> - joinpath (aka os.path.join) >> - abspath (aka os.path.abspath) >> > Yes, I

Re: [Python-ideas] Objectively Quantifying Readability

2018-05-01 Thread Eric Fahlgren
On Tue, May 1, 2018 at 8:04 AM, Jacco van Dorp wrote: > 2018-05-01 14:54 GMT+02:00 Greg Ewing : > > Rhodri James wrote: > >> > >> I'd be interested to know if there is a readability difference between > >> really_long_descriptive_identifier_name

Re: [Python-ideas] Should __builtins__ have some kind of pass-through print function, for debugging?

2018-04-28 Thread Eric Fahlgren
On Sat, Apr 28, 2018 at 4:27 AM, Steven D'Aprano <st...@pearwood.info> wrote: > On Fri, Apr 27, 2018 at 06:27:44AM -0700, Eric Fahlgren wrote: > > > I've had a 'dprint' in sitecustomize for years. It clones 'print' and > adds > > a couple of keyword parameters, 'sho

Re: [Python-ideas] Should __builtins__ have some kind of pass-through print function, for debugging?

2018-04-27 Thread Eric Fahlgren
I've had a 'dprint' in sitecustomize for years. It clones 'print' and adds a couple of keyword parameters, 'show_stack' and 'depth', which give control over traceback output (walks back up sys._getframe for 'depth' entries). It returns the final argument if there is one, otherwise None. It can

Re: [Python-ideas] Idea: Importing from arbitrary filenames

2018-04-16 Thread Eric Fahlgren
The documentation is pretty opaque or non-existent on other aspects of importlib use, too. If I enable warnings, I see this (and many more like it). I've read PEP 302 a couple times, read the code in importlib that detects the warning and searched down several rabbit holes, only to come up

Re: [Python-ideas] Move optional data out of pyc files

2018-04-10 Thread Eric Fahlgren
On Tue, Apr 10, 2018 at 5:03 PM, Steven D'Aprano wrote: > > __pycache__/spam.cpython-38.pyc > __pycache__/spam.cpython-38-doc.pyc > __pycache__/spam.cpython-38-lno.pyc > __pycache__/spam.cpython-38-ann.pyc > ​Our product uses the doc strings for

Re: [Python-ideas] Proposal: A Reduce-Map Comprehension and a "last" builtin

2018-04-06 Thread Eric Fahlgren
On Fri, Apr 6, 2018 at 7:47 AM, Peter O'Connor wrote: > 3) The idea that an assignment operation "a = f()" returns a value (a) is > already consistent with the "chained assignment" syntax of "b=a=f()" (which > can be thought of as "b=(a=f())"). I don't know why we

Re: [Python-ideas] Fixing class scope brainstorm

2018-03-27 Thread Eric Fahlgren
On Tue, Mar 27, 2018 at 9:52 AM, Paul Moore wrote: > I'd actually like to see some real world use cases to get a feel for > whether this is even worth worrying about. (I'm not saying it isn't, > just that it's hard to get a feel for the importance based on > artificial

Re: [Python-ideas] PEP 572 version 2: Statement-Local Name Bindings

2018-03-24 Thread Eric Fahlgren
On Sat, Mar 24, 2018 at 7:14 AM, Nick Coghlan wrote: > ​​ > >>> class C: > ... sequence = range(10) > ... listcomp = [x for x in sequence] > >>> class C: ... y = 1 ... sequence = range(10) ... listcomp = [x+y for x in sequence] ​ ...

Re: [Python-ideas] New PEP proposal -- Pathlib Module Should Contain All File Operations

2018-03-19 Thread Eric Fahlgren
On Mon, Mar 19, 2018 at 9:59 AM, Terry Reedy wrote: > I am convinced that *some* people, especially but not limited to newbies, > find the current situation confusing and less than optimal. I am also > pretty convinced that the idea of dumping a copy of everything into pathlib

Re: [Python-ideas] PEP 572 version 2: Statement-Local Name Bindings

2018-03-02 Thread Eric Fahlgren
On Fri, Mar 2, 2018 at 12:20 PM, Chris Angelico wrote: > How often do you have a loop like this where you actually want to > capture the exact condition? I can think of two: regular expressions > (match object or None), and socket read (returns empty string on EOF). > This

Re: [Python-ideas] PEP 572 version 2: Statement-Local Name Bindings

2018-03-02 Thread Eric Fahlgren
On Fri, Mar 2, 2018 at 10:27 AM, Jelle Zijlstra wrote: > > I wonder if we could have a more limited change to the language that would > allow only the as/while use cases. Specifically, that means we could do: > > while do_something() as x: > print(x) > ​The "while"

Re: [Python-ideas] Possible Enhancement to py Launcher - set default

2018-02-06 Thread Eric Fahlgren
On Tue, Feb 6, 2018 at 6:47 AM, Paul Moore wrote: > There are a few different points here: > > 1. There's no relationship between pip and the py launcher - they are > separate tools/projects. Any co-operation in terms of file locations > would have to be a result of common

Re: [Python-ideas] Possible Enhancement to py Launcher - set default

2018-02-06 Thread Eric Fahlgren
My only request for change would be to consolidate the various tools' behavior wrt their .ini file locations. Pip, for example, wants the file in ~/pip/pip.ini, while py.exe (on Windows) wants its py.ini in $LOCALAPPDATA. If they were all in a common location (or the same file with separate

Re: [Python-ideas] Repr of lambda

2017-12-21 Thread Eric Fahlgren
Could we call it "help"? Maybe add some beef to what's already there... >>> help(lambda x,y,*args: x) Help on function in module __main__: lambda x, y, *args On Thu, Dec 21, 2017 at 12:34 PM, Barry wrote: > > > > On 21 Dec 2017, at 06:57, Chris Barker

Re: [Python-ideas] Looking for input to help with the pip situation

2017-11-20 Thread Eric Fahlgren
​ On Mon, Nov 20, 2017 at 1:59 PM, Chris Barker wrote: > BTW -- does pip install a "pip3" on Windows? > ​ In 3.6 it does: > find t:/Python36/ -iname 'pip*exe' t:/Python36/Scripts/pip.exe t:/Python36/Scripts/pip3.6.exe t:/Python36/Scripts/pip3.exe ​

Re: [Python-ideas] Things that won't change (proposed PEP)

2017-01-12 Thread Eric Fahlgren
On Wed, Jan 11, 2017 at 8:28 PM, Chris Barker wrote: > Many of the things people (newbies, mostly) complain about are simply > taste, or legacy that isn't worth changing. > ​A lot of that sort of thing is idiomatic, so I point people here and say "just do it that way and