Python Forum
Where to suggest python syntax change ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Where to suggest python syntax change ?
#1
I have 3 things i'd like to post as a suggestion to python development team but have no idea where to find them or how to contact them.

Use + strictly for math operation
Use & strictly to COMBINE what ever you have.

For example:
5+5=10 math operator
5&5=55 combine operator
5+"string" = error
5&"string" = "5string"

Escape character.
"string \n continues" is a horrible way to break the string.
"string " & @LF & "continues" is allot better. It makes allot of visual sense.
It eliminates problems with typing paths such as "C:\Windows\network drive" OMG i just escaped the line ?
Fixing these accidental escape characters is a nightmare. You might as well get rid of them all and replace then with @NL new line or something else and utilize the above proposed COMBINE operator to join them as in: "line 1" & @NL & "line 2" etc
This method makes allot more sense to use then to use escape characters that can sometimes get you in allot of trouble.
Its easier to use & @NL & then to split the path into chunks and put it back together to avoid errors.

Also
Some imported libraries have internal function names that user may call with a function name.
If i have a code that uses a variable name that for what ever reason matching this function name, my code will be screwed unless i rename either function i am calling or all of my variable names that match.
For example:
variable named "printresult"
Imported library has function named "printresult"
Suddenly, when someone is looking at the code, he gets confused without even realizing that "printresult" is a function name inside imported module.

If there was a very simple way to visually differentiate variables from the rest of the code, code learning and code understanding would be a day/night difference.

So my question about variable naming is: Why cant we use $ symbol for variables ?
$printresult vs printresult are two VERY DIFFERENT words in my opinion and it will be allot easier for IDE to identify which one is which and give it a color of choice.

To this day, i have yet seen IDE that can tell variable from a object, class or a function.
All colored the same.
I do understand that you recognize them by how they are placed and where they are used, but my point is that: differentiating them visually will make learning python as well as reading and understanding the code allot easier.

Have a look at AutoIT script. Its super easy to understand whats going on because everything has very unique color identification.
Reply
#2
Mailing Lists under eg python-ideas.
We are not connect to python.org Who is python-forum.io.
Reply
#3
I think that one must understand that Python is programming language. I quote Guido van Rossum:

Quote:Typically when you ask a programmer to explain to a lay person what a programming language is, they will say that it is how you tell a computer what to do. But if that was all, why would they be so passionate about programming languages when they talk among themselves?

In reality, programming languages are how programmers express and communicate ideas — and the audience for those ideas is other programmers, not computers. The reason: the computer can take care of itself, but programmers are always working with other programmers, and poorly communicated ideas can cause expensive flops. In fact, ideas expressed in a programming language also often reach the end users of the program — people who will never read or even know about the program, but who nevertheless are affected by it.

Think of the incredible success of companies like Google or Facebook. At the core of these are ideas — ideas about what computers can do for people. To be effective, an idea must be expressed as a computer program, using a programming language. The language that is best to express an idea will give the team using that language a key advantage, because it gives the team members — people! — clarity about that idea. The ideas underlying Google and Facebook couldn't be more different, and indeed these companies' favorite programming languages are at opposite ends of the spectrum of programming language design. And that’s exactly my point.

True story: The first version of Google was written in Python. The reason: Python was the right language to express the original ideas that Larry Page and Sergey Brin had about how to index the web and organize search results. And they could run their ideas on a computer, too!

If you can't express yourself in Python you should choose another language.

I share your anger in 'disliking' some language. In my case it's english - I 'like' language which has no future tense, no gender, no articles before noun, you pronounce exactly as you write etc, etc (this is my mother tongue) Big Grin
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply
#4
if you have better ideas, go make a better language. take a copy of the Python system and modify the parsing interpreter to work your own way. you can even use the same .pyc file format for compiled objects and probably nearly all of the Python library. it's all open source licensed so it's legal. that would save you a lot of work. then we'll see who likes your language.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#5
It looks like you don't have much experience. Probably just AutoIt, right?
Otherwise you would not think to suggest drastic changes in the syntax of matured language like python that will cause tons of backward compatibility issues. What you suggest e.g. regarding concatenation, escape sequences - the way python handles these is common in many languages. And, by the way, python has idiomatic solutions how to handle e.g. unwanted escape sequences in paths (use raw strings or use forward slash) or regex expressions.

Learn the toolbox of the language you want to use, don't try to reshape it from foundations - e.g. its modular philosophy of core Standard Library and third part packages. Also stick to best practices - e.g. don't use star imports and you will avoid name collisions. If it's not your cup of tee - just move to another language.

Distinguish between language feature and IDE feature. what you think is language feature (syntax highlighting with respect to variables) is in fact IDE feature. There are hundreds of IDEs. If you don't like any of them - write your own with exactly the features you want.

As the saying goes - when in Rome, do like the Romans do. It's funny sometimes when someone coming from other language try to reshape python to be like the language they are used of. If it was so perfect you wouldn't look to switch to different language, right?
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#6
You want to do a syntax change without knowledge about Python?
Bad idea! Also the example is not Pythonic and does not follow the PEP8.

5 + 5 = 10 math operator
# It's the case

5 & 5 = 55 combine operator
# breaks all existing code!!!

5+"string" = error
# is a TypeError
# if you want to do this, use JavaScript

5&"string" = "5string"
# Type Error + this operation is not defined for strings
You request will not only make all existing code invalid, it will weakens the TypeSafety.
Before you make suggestions to change the syntax and behavior, you should learn Python and the history of Python.

I guess the developers get every day this crazy requests to change something.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#7
You can go to python.org and browse the 'Community' tab. In the 'Mailing Lists' entry, you'll find places where to suggest your ideas for the python language. That said, i'm pretty sure that both enhancements above will be rejected. Especially the $variable idea is anti-pythonic. It is a regression in terms of language design and there is no benefit at all.

If you want to avoid name collisions, which seem to be the issue here, solutions already exist, such as avoiding the import * construct and using qualified names. Take the time to discover python's solutions before suggesting revolution.
Reply
#8
simply said, the developers will have no interest in your suggestions. Python has been changed many times over many years (see the PEP discussions). it is very mature and still improving. but i think your ideas will "put off" too many experienced programmers to be considered for Python4 (the next version for incompatible changes).

you are not the first to suggest changes. neither was i when i started out and made suggestions which were much different than yours. the only suggestion i can give to you is to demonstrate that your changes are truly better. you can prepare to do this by making a runnable, working language system with your ideas in place. as implied by my previous post, you can apply your ideas (which are just syntax changes) to the existing Python system. just don't call it "Python". give it some other name. you can legally take the existing Python system and change it (in the parser and code conversion), and release this derived work under a new name. then you will have a basis to demonstrate how your ideas are better. those who are convinced will even have something to switch to.

or, go try Pike and see what changes you could make to it. Pike is, in many ways, similar to Python. it has infinite precision ints (which are faster than Python). it, also, has many differences. it has a C-like syntax (that will be your first ideas challenge. it has many different semantic bindings. it has its own separately implemented library system. and it is more strongly typed (except for the "mixed" type).
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#9
(Nov-19-2019, 11:48 PM)Skaperen Wrote: the only suggestion i can give to you is to demonstrate that your changes are truly better. you can prepare to do this by making a runnable, working language system with your ideas in place.

Autoit is doing what i proposed.
Reply
#10
tonycstech Wrote:Autoit is doing what i proposed.
But Autoit is not Python. Every scripting language has its internal coherence. By using a language, one acquires reflexes and habits, so you'd like to adapt Python to your own habits but that's not the way it works. After some time programming in Python, you will acquire new reflexes and habits and you will stop missing Autoit's syntax and texture.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Please suggest a good Data Science Book alexwazan 3 2,826 Sep-16-2019, 08:05 AM
Last Post: EleenaGates
  Can anyone suggest alternatives to opencv for Python Images readout Spandora 3 3,244 Mar-29-2019, 08:39 PM
Last Post: Spandora
  suggest specific tutorial SchroedingersLion 11 6,332 Oct-11-2018, 09:10 AM
Last Post: Micmilli2

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020