Re: python newbie: some surprises

2008-05-18 Thread Lie
On May 8, 2:06 pm, v4vijayakumar [EMAIL PROTECTED] wrote: When I started coding in python, these two things surprised me. 1. my code is inconsistently indented with the combination of tabs and spaces. Even lines looked intended, but it is not. The problem is in tab not Python, there is no

Re: python newbie: some surprises

2008-05-15 Thread Kees Bakker
Gabriel Genellina wrote: En Fri, 09 May 2008 10:37:30 -0300, v4vijayakumar [EMAIL PROTECTED] escribió: On May 9, 1:48 pm, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: v4vijayakumar a écrit : When I started coding in python, these two things surprised me. 1. my code is

Re: python newbie: some surprises

2008-05-15 Thread Marco Mariani
Kees Bakker wrote: So far, I have seen only one editor that understands the difference between TABs and indentation, and that is Emacs. Oh, well... in .vimrc: autocmd FileType python set tabstop=8 autocmd FileType python set softtabstop=4 autocmd FileType python set expandtab

Re: python newbie: some surprises

2008-05-15 Thread tinnews
Kees Bakker [EMAIL PROTECTED] wrote: So far, I have seen only one editor that understands the difference between TABs and indentation, and that is Emacs. Most vi clones (and the original vi) do too! :-) E.g. in the clone I use (vile) there are independent settings for tabstop and

Re: python newbie: some surprises

2008-05-10 Thread Gabriel Genellina
En Fri, 09 May 2008 10:37:30 -0300, v4vijayakumar [EMAIL PROTECTED] escribió: On May 9, 1:48 pm, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: v4vijayakumar a écrit : When I started coding in python, these two things surprised me. 1. my code is inconsistently indented with the

Re: python newbie: some surprises

2008-05-09 Thread Gabriel Genellina
En Fri, 09 May 2008 01:47:49 -0300, Yves Dorfsman [EMAIL PROTECTED] escribió: I see the point of the OP. Couldn't the new-line be used as an equivalent of ':', for example, do you find this difficult to read: if a == 3 do_something() if a == 3: do_something() And surely, it should

Re: python newbie: some surprises

2008-05-09 Thread Bruno Desthuilliers
v4vijayakumar a écrit : When I started coding in python, these two things surprised me. 1. my code is inconsistently indented with the combination of tabs and spaces. Even lines looked intended, but it is not. Then you have a problem with your code editor - not with Python. 2. python

Re: python newbie: some surprises

2008-05-09 Thread Bruno Desthuilliers
Yves Dorfsman a écrit : Mensanator wrote: 2. python requires to pass self to all instance methods Who uses methods? Is this a joke ? Very probably. What are the alternatives ? Err... functions ?-) -- http://mail.python.org/mailman/listinfo/python-list

Re: python newbie: some surprises

2008-05-09 Thread Bruno Desthuilliers
Yves Dorfsman a écrit : (snip) I see the point of the OP. Couldn't the new-line be used as an equivalent of ':', Technically, yes. OTHO, the ':' helps editors doing proper indentation. -- http://mail.python.org/mailman/listinfo/python-list

Re: python newbie: some surprises

2008-05-09 Thread v4vijayakumar
On May 9, 1:48 pm, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: v4vijayakumar a écrit : When I started coding in python, these two things surprised me. 1. my code is inconsistently indented with the combination of tabs and spaces. Even lines looked intended, but it is not. Then

Re: python newbie: some surprises

2008-05-09 Thread Yves Dorfsman
Gabriel Genellina wrote: I see the point of the OP. Couldn't the new-line be used as an equivalent of ':', for example, do you find this difficult to read: if a == 3 do_something() if a == 3: do_something() Yes, it could be done, there are no technical reasons to always force to use

Re: python newbie: some surprises

2008-05-09 Thread J. Cliff Dyer
On Fri, 2008-05-09 at 15:08 +, Yves Dorfsman wrote: Gabriel Genellina wrote: I see the point of the OP. Couldn't the new-line be used as an equivalent of ':', for example, do you find this difficult to read: if a == 3 do_something() if a == 3: do_something() Yes,

python newbie: some surprises

2008-05-08 Thread v4vijayakumar
When I started coding in python, these two things surprised me. 1. my code is inconsistently indented with the combination of tabs and spaces. Even lines looked intended, but it is not. 2. python requires to pass self to all instance methods and I missed : often. :) --

Re: python newbie: some surprises

2008-05-08 Thread Martin P. Hellwig
v4vijayakumar wrote: When I started coding in python, these two things surprised me. 1. my code is inconsistently indented with the combination of tabs and spaces. Even lines looked intended, but it is not. Even the standard editor Idle tries to guess the intendation, so this was never a

Re: python newbie: some surprises

2008-05-08 Thread Mensanator
On May 8, 2:06 am, v4vijayakumar [EMAIL PROTECTED] wrote: When I started coding in python, these two things surprised me. 1. my code is inconsistently indented with the combination of tabs and spaces. Even lines looked intended, but it is not. You must type inconsistently. I never had such a

Re: python newbie: some surprises

2008-05-08 Thread Yves Dorfsman
Mensanator wrote: 2. python requires to pass self to all instance methods Who uses methods? Is this a joke ? What are the alternatives ? and I missed : often. :) Try using something like Seed7, where you have to use then with if and do with while and end in every block. Maybe you'll

Re: python newbie: some surprises

2008-05-08 Thread Mensanator
On May 8, 11:47�pm, Yves Dorfsman [EMAIL PROTECTED] wrote: Mensanator wrote: 2. python requires to pass self to all instance methods Who uses methods? Is this a joke ? Yes. What are the alternatives ? and I missed : often. :) Try using something like Seed7, where you have to use