473,403 Members | 2,366 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

is it possible to remove the ':' symbol in the end of lines starting with 'if', 'while' etc?

I don't know to which forum should I post the message
I hope someone related to the Python kernel development will read &
consider the idea
I'm (a former? meanwhile not sure) MATLAB user & it's very annoing
typing each time for example
while i:
print i
...
instead of
while i
print i
...
of course if all is written in a single line ':' I guess should not be
omited

Thank you for you suggestions.
Sorry my bad English.

WBR, Dmitrey

Feb 22 '07 #1
8 1445
op*****@ukr.net wrote:
I don't know to which forum should I post the message
I hope someone related to the Python kernel development will read &
consider the idea
I'm (a former? meanwhile not sure) MATLAB user & it's very annoing
typing each time for example
while i:
print i
...
instead of
while i
print i
...
of course if all is written in a single line ':' I guess should not be
omited
Won't happen. There have been plenty of discussions about this, and while
technically not necessary, the colon is usually considered "optically
pleasing". So - it will stay.

See - one of a bazillion - discussions here:

http://groups.google.com/group/comp....581ad9698e28f5
Diez
Feb 22 '07 #2
On Feb 22, 9:49 am, open...@ukr.net wrote:
I don't know to which forum should I post the message
I hope someone related to the Python kernel development will read &
consider the idea
I'm (a former? meanwhile not sure) MATLAB user & it's very annoing
typing each time for example
while i:
print i
...
instead of
while i
print i
...
of course if all is written in a single line ':' I guess should not be
omited

Thank you for you suggestions.
Sorry my bad English.

WBR, Dmitrey
Think on the bright side:

you have to type ":" at the beginning of loop and conditional blocks,
but you don't have to type "end" at the end... you are still saving
two strokes...
;-))

Feb 22 '07 #3
On 22 Feb, 11:49, open...@ukr.net wrote:
I don't know to which forum should I post the message
I hope someone related to the Python kernel development will read &
consider the idea
I'm (a former? meanwhile not sure) MATLAB user & it's very annoing
typing each time for example
while i:
print i
...
instead of
while i
print i
...
of course if all is written in a single line ':' I guess should not be
omited

Thank you for you suggestions.
Sorry my bad English.

WBR, Dmitrey
Hi

Just a thought...
I've also just made the jump from Matlab to Python (or am straddling
the two at the moment!) and I find the ':' really useful for
delimiting blocks of code. Took a while to get used to it but I reckon
it helps me explain my code to non-programmers as they can see the
blocks I use.

Al

Feb 22 '07 #4
Think on the bright side:
>
you have to type ":" at the beginning of loop and conditional blocks,
but you don't have to type "end" at the end... you are still saving
two strokes...
;-))
No, there no profits:
instead of 'end' I must type <shift>, ':' and backspace in the end of
block - so 3 keypress are used, same as 'end'
Of course Python is much more better in syntax vs C/C++ but I would
prefere tcl-style or caml-style
x = fun arg1 arg2 ... argn
however, in tcl annoing things are 'set' and 'expr'
and in ocaml '<-' and 'let x = ... in' - too many keypress instead of
'='
but their func calls still is better then fun(arg1, arg2, ..., argn)
and help _something_ or which _something_ in MATLAB is much more
better then help(_something_) in Python
the only bad thing in MATLAB (+absence of x = fun arg1 arg2 ... argn
call) is indexing arrays by () instead of [] - holding shift key
dozens times per day is very unconvinient.
And in Python vs MATLAB is very unconvinient arrays creation.

I'm very afraid of proposition that I noticed at
http://wiki.python.org/moin/SummerOfCode
Base multidimensional array type for Python core
Student: KarolLangner
Mentor: Travis E. Oliphant
I don't know about anyone mentioned but I'm not sure this is a good
idea to hire ordinary student for such important thing.
And writing 'dimarray(...)' dozens times per day is much more bad than
x = matrix('...'), x = array([...]) or, of course, MATLAB-style x = [1
2 3]
I guess it should 10 times more think about the array and make it once
and forever - Python already has some array-related classes and all
with syntax much more bad than MATLAB. I guess there should be only 2
types: one for storing data in convinient way without reallocating
(something like C++ STL vector<>) and one for quick calculations
(something like C++ valarray).
WBR, Dmitrey.

Feb 22 '07 #5
op*****@ukr.net wrote:
I don't know to which forum should I post the message
I hope someone related to the Python kernel development will read &
consider the idea
I'm (a former? meanwhile not sure) MATLAB user & it's very annoing
typing each time for example
while i:
print i
...
instead of
while i
print i
...
of course if all is written in a single line ':' I guess should not be
omited

Thank you for you suggestions.
Sorry my bad English.

WBR, Dmitrey
Its a compromise in that python has way-less of this kind of cruft than
a lot of other languages.

James
Feb 22 '07 #6
Tip: don't try learning perl.

I agree the colon is largely redundant, but it's not unreasonable.

Feb 22 '07 #7
On 2007-02-22, tac-tics <ta*******@gmail.comwrote:
Tip: don't try learning perl.

I agree the colon is largely redundant, but it's not
unreasonable.
A certain amount of redundancy in languages (artificial or
natrual) is a good thing. It makes error detection and
correction far easier.

--
Grant Edwards grante Yow! ... I think I'm
at having an overnight
visi.com sensation right now!!
Feb 23 '07 #8
"Diez B. Roggisch" <de***@nospam.web.dewrote:
op*****@ukr.net wrote:
8< ---------------- request to remove colon ----------------------
Won't happen. There have been plenty of discussions about this, and while
technically not necessary, the colon is usually considered "optically
pleasing". So - it will stay.
It is also used by text editors to make indentation of the next line happen...

- Hendrik

Feb 23 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: qwweeeit | last post by:
For a python code I am writing I need to remove all strings definitions from source and substitute them with a place-holder. To make clearer: line 45 sVar="this is the string assigned to sVar"...
2
by: Peter Gomis | last post by:
I have encountered a situation where I am unable to remove a .NET assembly from the GAC. The message I receive is "Assembly 'assemblyname' could not be uninstalled because it is required by other...
5
by: jjliu | last post by:
Could someone tell me how to remove all html tags (and anything inside tags) by perl. Some people suggested me to use HTML::TagFilter but i could not find window version. Thanks very much for your...
6
by: Olivier Lechenne | last post by:
I am converting some projects from VS 6.0 to VS .NET 2003 and I get a linker error error LNK2001: unresolved external symbol ___security_cookie or error LNK2001: unresolved external symbol...
3
by: Niyazi | last post by:
Hi all, I have a dataTable that contains nearly 38400 rows. In the dataTable consist of 3 column. column 1 Name: MUHNO column 2 Name: HESNO Column 3 Name: BALANCE Let me give you some...
3
by: Li Pang | last post by:
Hi, I want to know the easiest way to remove the last line in a text file, or how to catch the last line of a text file. Thanks in advance
32
by: SAL | last post by:
Hello, I do not have any trouble declaring string values except when it comes to directory path's. Why does C# implicitly put a @ symbol at the being of a String value that has been declared...
7
by: peraklo | last post by:
Hello, there is another problem i am facing. i have a text file which is about 15000 lines big. i have to cut the last 27 lines from that file and create a new text file that contans those 27...
5
by: LEM | last post by:
Hi, I'm trying to remove any empty lines from a string, and I am doing the following: String pp; pp = "\r\n\r\n1\r\n23\r\n\r\n4"; pp = pp.Replace("\r\n\r\n", "\r\n");
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.