ANN: Wing Python IDE 7.2.8 has been released

2021-01-14 Thread Wingware
Wing 7.2.8 fixes reformatting selections for PEP8, corrects completion of code reformatting in remote files when code is unchanged, fixes problems analyzing incomplete 'def async' statements, correctly handles refactor module rename when the target name exists, adds a preference to control the

Re: count consecutive elements

2021-01-14 Thread Dan Stromberg
On Wed, Jan 13, 2021 at 6:20 PM Dan Stromberg wrote: > On Wed, Jan 13, 2021 at 5:59 PM Tim Chase > wrote: > >> On 2021-01-13 21:20, Bischoop wrote: >> > I want to to display a number or an alphabet which appears mostly >> > consecutive in a given string or numbers or both >> > Examples >> > s=

[ANN] PyYAML-5.4b1: Linux and Mac users, please test wheels!

2021-01-14 Thread Matt Davis
=== Announcing PyYAML-5.4b1 === A beta release of PyYAML is now available: https://github.com/yaml/pyyaml/releases/tag/5.4b1 This release contains a security fix for CVE-2020-14343. It removes the python/module, python/object, and python/object/new tags fro

Exploring terminfo

2021-01-14 Thread Alan Gauld via Python-list
During lockdown I've been digging deeper into the curses module and lately into the ti family of functions that reside there. I've written a short program that is supposed to - *clear the screen*, - read some input - display the result in a message *highlighted in bold*. - get input to end the

Re: count consecutive elements

2021-01-14 Thread Bischoop
On 2021-01-13, Bischoop wrote: I know what was wrong: > m = s.index(i) I forgot that m will return first index of i. So tried that way but still getting out of index although I that that I'm making sure not to get out of index. s = 'aabskaaabadh' c = 0 t = list(set(s)) # list

Question - problem downloading Python

2021-01-14 Thread christine tiscareno
I installed in my lap-top your latest version of Python (3.9.1), yet when I go to cmd.exe to check, I get that I have Python 22.7.17 ??? Why? What should I do to get the latest version? I tried going back to fix problems and it does not fix it, that is how I got your email. How can I get th

Re: conceptual problem

2021-01-14 Thread Alan Gauld via Python-list
On 13/01/2021 15:37, songbird wrote: > my momentary conceptual problem is that to me OOP means > being able to encapsulate data structures and code from > other parts of the program, That's true, but encapsulation simply means that the data and functions are contained within a single entity -

Re: A beginning beginner's question about input, output and . . .

2021-01-14 Thread Peter Pearson
On Wed, 13 Jan 2021 21:46:08 - (UTC), Grant Edwards wrote: > On 2021-01-13, Peter Pearson wrote: [snip] >> Browsergui is not widely popular (I don't think anybody but me has >> mentioned it on this newsgroup), but it was written to be simple and >> Pythonic, and has served me well. Browsergui

why sqrt is not a built-in function?

2021-01-14 Thread Denys Contant
I don't understand why sqrt is not a built-in function. Why do we have to first import the function from the math module? I use it ALL THE TIME! That felt good. Thank you. -- https://mail.python.org/mailman/listinfo/python-list

Re: why sqrt is not a built-in function?

2021-01-14 Thread jak
Il 14/01/2021 18:44, Denys Contant ha scritto: I don't understand why sqrt is not a built-in function. Why do we have to first import the function from the math module? I use it ALL THE TIME! That felt good. Thank you. >>> val=16 >>> exp=2 >>> val ** (1/exp) 4.0 >>> -- https://mail.pytho

Re: why sqrt is not a built-in function?

2021-01-14 Thread Skip Montanaro
> I don't understand why sqrt is not a built-in function. > Why do we have to first import the function from the math module? > I use it ALL THE TIME! For one, it's specific to numeric types. You might use it all the time, but I (for example) almost never need to use it, or to import the math modu

Re: why sqrt is not a built-in function?

2021-01-14 Thread Alan Gauld via Python-list
On 14/01/2021 17:44, Denys Contant wrote: > I don't understand why sqrt is not a built-in function. > Why do we have to first import the function from the math module? > I use it ALL THE TIME! because pow() is a builtin function and root = pow(x,0.5) is the same as root = math.sqrt(x) As is

Re: why sqrt is not a built-in function?

2021-01-14 Thread Ethan Furman
On 1/14/21 9:44 AM, Denys Contant wrote: I don't understand why sqrt is not a built-in function. Why do we have to first import the function from the math module? I use it ALL THE TIME! And thousands, tens of thousands, and maybe hundreds of thousands don't. That felt good. Thank you. Any

Re: why sqrt is not a built-in function?

2021-01-14 Thread 2QdxY4RzWzUUiLuE
On 2021-01-14 at 17:54:55 +, Alan Gauld via Python-list wrote: > My question is: why do we even have a sqrt() in the > math module given that pow() and ** are already there? Probably because the standard C math library has such a function, and Python's math module is (or at least was) suppos

Re: why sqrt is not a built-in function?

2021-01-14 Thread Chris Angelico
On Fri, Jan 15, 2021 at 5:56 AM <2qdxy4rzwzuui...@potatochowder.com> wrote: > > On 2021-01-14 at 17:54:55 +, > Alan Gauld via Python-list wrote: > > > My question is: why do we even have a sqrt() in the > > math module given that pow() and ** are already there? > > Probably because the standar

Re: why sqrt is not a built-in function?

2021-01-14 Thread Eli the Bearded
In comp.lang.python, Skip Montanaro wrote: > Finally, should have never considered it, I think you might want to > study the output of > > import this > > Think on the second and last lines in particular. >>> import this The Zen of Python, by Tim Peters Beautiful is better than ugly.

Re: why sqrt is not a built-in function?

2021-01-14 Thread Chris Angelico
On Fri, Jan 15, 2021 at 6:11 AM Eli the Bearded <*@eli.users.panix.com> wrote: > > In comp.lang.python, Skip Montanaro wrote: > > Finally, should have never considered it, I think you might want to > > study the output of > > > > import this > > > > Think on the second and last lines in particula

Re: why sqrt is not a built-in function?

2021-01-14 Thread Ethan Furman
On 1/14/21 11:06 AM, Eli the Bearded wrote: "There should be one-- and preferably only one --obvious way to do it." Meanwhile, Alan Gauld pointed out: AG> because pow() is a builtin function and AG> root = pow(x,0.5) AG> is the same as AG> root = math.sqrt(x) Plus the ** operation

Re: Question - problem downloading Python

2021-01-14 Thread vincent . vandevyvre
On 14/01/21 07:52, Christine Tiscareno wrote: >I installed in my lap-top your latest version of Python (3.9.1), yet when I >go to cmd.exe to check, I get that I have Python 22.7.17 ??? > >Why? What should I do to get the latest version? > I tried going back to fix problems and it does not fix

Re: Exploring terminfo

2021-01-14 Thread Barry Scott
> On 14 Jan 2021, at 16:12, Alan Gauld via Python-list > wrote: > > During lockdown I've been digging deeper into the curses module > and lately into the ti family of functions that reside there. > > I've written a short program that is supposed to > - *clear the screen*, > - read some i

Re: Question - problem downloading Python

2021-01-14 Thread Barry Scott
> On 14 Jan 2021, at 06:52, christine tiscareno wrote: > > I installed in my lap-top your latest version of Python (3.9.1), yet when I > go to cmd.exe to check, I get that I have Python 22.7.17 ??? > > Why? What should I do to get the latest version? > > I tried going back to fix problem

Re: count consecutive elements

2021-01-14 Thread Wolfram Hinderer via Python-list
Am 13.01.2021 um 22:20 schrieb Bischoop: I want to to display a number or an alphabet which appears mostly consecutive in a given string or numbers or both Examples s= ' aabskaaabad' output: c # c appears 4 consecutive times 8bbakebaoa output: b #b appears 2 consecutive times You can

Re: Exploring terminfo

2021-01-14 Thread Eli the Bearded
In comp.lang.python, Barry Scott wrote: > Alan Gauld via Python-list wrote: >> I've written a short program that is supposed to >> - *clear the screen*, >> - read some input >> - display the result in a message *highlighted in bold*. >> - get input to end the program > It seems that curses does

Re: Exploring terminfo

2021-01-14 Thread Grant Edwards
On 2021-01-14, Barry Scott wrote: > It seems that curses does not allow you to mix raw stdin/stdout with > its calls. (got that idea from a quick web search). That is definitely the case. Output in curses is done to an in-memory virtual terminal screen. Optimized output is then sent (at some po

Re: Exploring terminfo

2021-01-14 Thread Grant Edwards
On 2021-01-14, Eli the Bearded <*@eli.users.panix.com> wrote: > When I've wanted to do simple things like bold and clear, I've used the > tput(1) tool. You can capture stdout from the tool and use the output > over and over. Typically I've done this in shell scripts: > > #!/bin/sh > bold=$(tput sm

RE: why sqrt is not a built-in function?

2021-01-14 Thread Avi Gross via Python-list
Ethan, if it is not obvious, then should we add the following functions just in case? cube_root() fourth_root() nth(root) two_thirds_root() e_th_root() pi_th_root() x_ove

Friday Finking: Abstract Base Classes - love or hate

2021-01-14 Thread dn via Python-list
Do you make frequent use of Abstract Base Classes (ABCs), prefer to use an ordinary super-class for the same purpose, or steer-clear? Are they more-usually employed when the project includes an extensive design stage, and the meta-class integral to some hierarchy of entities? Previous Friday Fink

Re: why sqrt is not a built-in function?

2021-01-14 Thread Eli the Bearded
In comp.lang.python, Ethan Furman wrote: > On 1/14/21 11:06 AM, Eli the Bearded wrote: >> "There should be one-- and preferably only one --obvious way to do it." >> Plus the ** operation ("root = x ** 0.5"), that's now three ways. > Yes, but which of those is obvious? If it's up to me, the ** on

Re: why sqrt is not a built-in function?

2021-01-14 Thread Greg Ewing
Aother thing to consider is that math.sqrt is not the only sqrt function in Python. There is also one in cmath, and in the wider ecosystem, another one in numpy. Being explicit about which one you're using is a good thing. Concerning exponentiation, it can be used to achieve the same thing as sqr

Re: conceptual problem (was: A beginning beginner's question about input, output and . . .

2021-01-14 Thread Greg Ewing
On 14/01/21 11:49 am, Cameron Simpson wrote: The "pure" OOP approach, where method calls are used as messages to set or fetch aspects of the object, is usually does with getter and setter methods like: x = o.getX() o.setX(9) People use get and set methods, not because it's somehow mo