HP Forums
Python survey 2020 - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: Not HP Calculators (/forum-7.html)
+--- Forum: Not remotely HP Calculators (/forum-9.html)
+--- Thread: Python survey 2020 (/thread-15812.html)



Python survey 2020 - compsystems - 10-30-2020 02:25 PM

Hello
What does Python need to be a super language?
If you want you can share your ideas in this forum and in the following survey.

https://surveys.jetbrains.com/s3/c8-python-developers-survey-2020

1: A type of symbolic object for algebraic manipulation CAS
2: ...


There is also a draw with 100 winners (surprise prize) to whoever completes the form


RE: Python survey 2020 - pinkman - 10-30-2020 08:36 PM

Is it well translated in multiple languages, or did you have to answer in French? Smile
It is a high quality survey.


RE: Python survey 2020 - Wes Loewer - 11-01-2020 05:59 AM

I know they won't add it, but Python could use a DO-WHILE or REPEAT-UNTIL or equivalent loop structure where the condition is evaluated at the end of the loop. I don't know that I've ever used a language without such a loop construct. I know you can use a "while True:" and a "break" but that looks so kludgy.

(On the plus side, I don't know that I've seen another language with the while-else construction that Python has. That's kind of cool.)


RE: Python survey 2020 - Albert Chan - 11-01-2020 10:51 AM

(11-01-2020 05:59 AM)Wes Loewer Wrote:  I know they won't add it, but Python could use a DO-WHILE or REPEAT-UNTIL ...

Assumed Python do have repeat/until:

repeat:
      ... # some code
      if condition: continue
      bad = 0
      ... # code that might turned "bad"
until bad

if condition is true, it will jump to line "until bad".
However, bad is a local variable, not existed before condition test.
(Or worse, bad existed outside repeat/until loop, and used for until ...)

You could solve it by moving up bad=0 before the condition test.
But, that would be messy to document repeat/until usage.

Static typed language does not have this problem. Code won't compile.


RE: Python survey 2020 - Dave Britten - 11-01-2020 02:25 PM

A native BCD decimal data type would be a big step in the right direction. C# handles it very well.


RE: Python survey 2020 - toml_12953 - 11-01-2020 04:45 PM

(11-01-2020 05:59 AM)Wes Loewer Wrote:  I know they won't add it, but Python could use a DO-WHILE or REPEAT-UNTIL or equivalent loop structure where the condition is evaluated at the end of the loop. I don't know that I've ever used a language without such a loop construct. I know you can use a "while True:" and a "break" but that looks so kludgy.

(On the plus side, I don't know that I've seen another language with the while-else construction that Python has. That's kind of cool.)

You can do this:

Code:
while True:
   do something
   do some more
   a += 1
   If a >= 10:
      Break


That's the equivalent of
Code:
DO
   do something
   do some more
   a = a + 1
LOOP WHILE a < 10

I know you think it looks kludgy as did I, coming from a BASIC background, but if you use Python for a while you get used to it. Since Python programmers think in terms of While True, there's no incentive to change it.