Re: editor recommendations?

2021-03-02 Thread Dan Stromberg
On Tue, Mar 2, 2021 at 8:11 PM Dan Stromberg wrote: > > On Tue, Mar 2, 2021 at 8:00 PM Russell wrote: > >> Ethan Furman wrote: >> > I'm currently using vim, and the primary reason I've stuck with it for >> so long is because I can get truly black screens with it. By which I mean >> that I have

Re: Why assert is not a function?

2021-03-02 Thread Chris Angelico
On Wed, Mar 3, 2021 at 2:06 PM Greg Ewing wrote: > > On 3/03/21 12:24 pm, Chris Angelico wrote: > > if PRODUCTION: > > def assert(*a, **kw): pass > > > > would work if it were a function :) > > But would cost you a useless function call for every assert > in production mode. > A micro-optimi

Re: editor recommendations?

2021-03-02 Thread Dan Stromberg
On Tue, Mar 2, 2021 at 8:00 PM Russell wrote: > Ethan Furman wrote: > > I'm currently using vim, and the primary reason I've stuck with it for > so long is because I can get truly black screens with it. By which I mean > that I have a colorful window title bar, a light-grey menu bar, and then a

Re: editor recommendations?

2021-03-02 Thread Russell
Ethan Furman wrote: > I'm currently using vim, and the primary reason I've stuck with it for so > long is because I can get truly black screens with it. By which I mean that > I have a colorful window title bar, a light-grey menu bar, and then a > light-grey frame around the text-editing windo

Re: Why assert is not a function?

2021-03-02 Thread Greg Ewing
On 3/03/21 12:24 pm, Chris Angelico wrote: if PRODUCTION: def assert(*a, **kw): pass would work if it were a function :) But would cost you a useless function call for every assert in production mode. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Tkinter long-running window freezes

2021-03-02 Thread John O'Hagan
On Wed, 24 Feb 2021 22:35:32 +1100 John O'Hagan wrote: > Hi list > > I have a 3.9 tkinter interface that displays data from an arbitrary > number of threads, each of which runs for an arbitrary period of time. > A frame opens in the root window when each thread starts and closes > when it stops.

Re: yield from () Was: Re: weirdness with list()

2021-03-02 Thread Cameron Simpson
On 02Mar2021 15:06, Larry Martell wrote: >I discovered something new (to me) yesterday. Was writing a unit test >for generator function and I found that none of the function got >executed at all until I iterated on the return value. Aye. Generators are lazy - they don't run at all until you ask f

Re: Why assert is not a function?

2021-03-02 Thread Chris Angelico
On Wed, Mar 3, 2021 at 10:48 AM Hexamorph wrote: > > Am 03.03.2021 um 00:24 schrieb Chris Angelico: > > On Wed, Mar 3, 2021 at 10:22 AM Mirko via Python-list > > wrote: > >> > >> Am 02.03.2021 um 23:09 schrieb Stestagg: > >>> Ignoring the question about this feature being particularly useful, it

Re: Why assert is not a function?

2021-03-02 Thread Hexamorph
Am 03.03.2021 um 00:24 schrieb Chris Angelico: > On Wed, Mar 3, 2021 at 10:22 AM Mirko via Python-list > wrote: >> >> Am 02.03.2021 um 23:09 schrieb Stestagg: >>> Ignoring the question about this feature being particularly useful, it >> >> It is useful because "assert" is primarily (if not purely

Re: Why assert is not a function?

2021-03-02 Thread Chris Angelico
On Wed, Mar 3, 2021 at 10:22 AM Mirko via Python-list wrote: > > Am 02.03.2021 um 23:09 schrieb Stestagg: > > Ignoring the question about this feature being particularly useful, it > > It is useful because "assert" is primarily (if not purely and > exclusive) a debugging tool during development an

Re: Why assert is not a function?

2021-03-02 Thread Mirko via Python-list
Am 02.03.2021 um 23:09 schrieb Stestagg: > Ignoring the question about this feature being particularly useful, it It is useful because "assert" is primarily (if not purely and exclusive) a debugging tool during development and testing. In production code you don't want any asserts, but logging. H

Re: yield from () Was: Re: weirdness with list()

2021-03-02 Thread Larry Martell
On Tue, Mar 2, 2021 at 2:16 PM Chris Angelico wrote: > > On Tue, Mar 2, 2021 at 5:51 AM Alan Gauld via Python-list > wrote: > > > > On 28/02/2021 00:17, Cameron Simpson wrote: > > > > > BUT... It also has a __iter__ value, which like any Box iterates over > > > the subboxes. For MDAT that is impl

Re: yield from () Was: Re: weirdness with list()

2021-03-02 Thread Marco Sulla
On Mon, 1 Mar 2021 at 19:51, Alan Gauld via Python-list wrote: > Sorry, a bit OT but I'm curious. I haven't seen > this before: > > yield from () > > What is it doing? > What do the () represent in this context? It's the empty tuple. -- https://mail.python.org/mailman/listinfo/python-list

Re: Why assert is not a function?

2021-03-02 Thread Barry
> On 2 Mar 2021, at 20:54, Marco Sulla wrote: > > I have a curiosity. Python, as many languages, has assert as a > keyword. Can't it be implemented as a function? Is there an advantage > to have it as a keyword? assert condition, expression Only is condition is false with expression be evalu

Python 3.10.0a6 is available, now with 100% more pattern matching

2021-03-02 Thread Pablo Galindo Salgado
Remember us? It's your friendly CPython release team and we have something we think you may like: The new alpha release of Python 3.10 is here, now with 100% more pattern matching. If I were you, I would download it and start playing with it. Extra points if you report us any bugs you find along th

Re: yield from () Was: Re: weirdness with list()

2021-03-02 Thread Chris Angelico
On Tue, Mar 2, 2021 at 5:51 AM Alan Gauld via Python-list wrote: > > On 28/02/2021 00:17, Cameron Simpson wrote: > > > BUT... It also has a __iter__ value, which like any Box iterates over > > the subboxes. For MDAT that is implemented like this: > > > > def __iter__(self): > > yield f

Re: Why assert is not a function?

2021-03-02 Thread Stestagg
There is also the, I think seldom used, feature that calling python with '-O' removes all assert statements at parse/compile time (I believe for performance reasons) So for example: $ python -c 'assert False' Traceback (most recent call last): File "", line 1, in AssertionError But: $ python

Re: is not recognized as an internal or external command, operable program or batch file.

2021-03-02 Thread Roland Mueller via Python-list
Hello, this is windows setup issue related to the fact that python binary is not in execution path. For setting up you may find instructions by searching for "windows 10 put python to path". One result is following page: https://superuser.com/questions/143119/how-do-i-add-python-to-the-windows-pat

Re: yield from () Was: Re: weirdness with list()

2021-03-02 Thread Alan Gauld via Python-list
On 28/02/2021 23:47, Alan Gauld via Python-list wrote: > On 28/02/2021 00:17, Cameron Simpson wrote: > >> BUT... It also has a __iter__ value, which like any Box iterates over >> the subboxes. For MDAT that is implemented like this: >> >> def __iter__(self): >> yield from () > > Sorr

Re: yield from () Was: Re: weirdness with list()

2021-03-02 Thread Chris Angelico
On Wed, Mar 3, 2021 at 8:21 AM Dieter Maurer wrote: > > Alan Gauld wrote at 2021-2-28 23:47 +: > >yield from () > > "yield from iterator" is similar to "for i in iterator: yield i" (with > special handling when data/exceptions are injected into the generator). > > Thus, "yield from ()" does es

yield from () Was: Re: weirdness with list()

2021-03-02 Thread Dieter Maurer
Alan Gauld wrote at 2021-2-28 23:47 +: >yield from () "yield from iterator" is similar to "for i in iterator: yield i" (with special handling when data/exceptions are injected into the generator). Thus, "yield from ()" does essentially nothing with the side effect that the containing function

Re: Why assert is not a function?

2021-03-02 Thread Chris Angelico
On Wed, Mar 3, 2021 at 7:53 AM Marco Sulla wrote: > > I have a curiosity. Python, as many languages, has assert as a > keyword. Can't it be implemented as a function? Is there an advantage > to have it as a keyword? It could, but it would need some magic. A lot of test frameworks have their own s

Re: yield from () Was: Re: weirdness with list()

2021-03-02 Thread Peter Otten
On 01/03/2021 00:47, Alan Gauld via Python-list wrote: On 28/02/2021 00:17, Cameron Simpson wrote: BUT... It also has a __iter__ value, which like any Box iterates over the subboxes. For MDAT that is implemented like this: def __iter__(self): yield from () Sorry, a bit OT but I

Re: try to install Python3.9.2 / setup failed

2021-03-02 Thread Mats Wichmann
On 3/1/21 10:46 AM, manfred.schm...@posteo.de wrote: Hello Python Team, i tried to install SW above; the installation stopped with the message "one or more issues caused the setup to fail. Please the issues and then retry 0x80070642 installation stopped by user" What must i do go get the SW in

Why assert is not a function?

2021-03-02 Thread Marco Sulla
I have a curiosity. Python, as many languages, has assert as a keyword. Can't it be implemented as a function? Is there an advantage to have it as a keyword? -- https://mail.python.org/mailman/listinfo/python-list

[RELEASE] Python 3.10.0a6 is available, now with 100% more pattern matching

2021-03-02 Thread Pablo Galindo Salgado
Remember us? It's your friendly CPython release team and we have something we think you may like: The new alpha release of Python 3.10 is here, now with 100% more pattern matching. If I were you, I would download it and start playing with it. Extra points if you report us any bugs you find along th

Re: is not recognized as an internal or external command, operable program or batch file.

2021-03-02 Thread Igor Korot
Hi, On Mon, Mar 1, 2021 at 12:56 PM singh.veer9--- via Python-list wrote: > >Dear Sir/Madam > >Sir I am facing the issue from 10 days. And I tried all the ways to remove >this or to come out of this problem >but as i try to install some PYTEST or OPENPYXL packages using pip it

Re: weirdness with list()

2021-03-02 Thread Cameron Simpson
On 01Mar2021 14:10, Grant Edwards wrote: >That was certainly my reaction. Can you imagine the confusion if len() >of a list returned the number of bytes required for srorage insttead >of the number of elements? Yeah, well the ancestry of these classes is a binary deserialise/serialise base class

Re: yield from () Was: Re: weirdness with list()

2021-03-02 Thread Cameron Simpson
On 28Feb2021 23:47, Alan Gauld wrote: >On 28/02/2021 00:17, Cameron Simpson wrote: >> BUT... It also has a __iter__ value, which like any Box iterates over >> the subboxes. For MDAT that is implemented like this: >> >> def __iter__(self): >> yield from () > >Sorry, a bit OT but I'm cur