Re: Tabnanny errors when Migrating Python 2.4 code to 2.5

2008-01-05 Thread Mike Driscoll
 I'm using Windows XP, using IDLE (which was mentioned already)

 in the context of editing/displaying code, not executing it. Does the
 problem occur before or after you edit a file with IDLE?

Actually, neither. I'm not editing the code. I open it in IDLE in 2.5
and attempt to run it through the Run menu Run Module menu item or
by pressing F5. It immediately fails with a tabnanny error. If I run
it from 2.4's IDLE, it works.

 and I
 downloaded the 2.5.1 exe/msi file from python.org to install it.

 What you downloaded doesn't answer the question about how you
 installed it. Do you still have your 2.4 installation?

Yes, I use both 2.4 and 2.5 as I migrate from one to the other. I've
attached a file that causes it consistently. On two systems with both
2.4 and 2.5 installed, it fails on line 206 when run from the IDLE
included with 2.5.

 I have yet to find a simple one which exhibits the issue to post. It
 seems to happen to my complex files, not the simple ones.

 So chop up a complex file ...
 Have you inspected the failing files using a text editor that can
 display tabs and spaces (e.g. PythonWin, TextPad)?

I just used Notepad++ to inspect the file and it does indeed have tabs
at line 206 rather than spaces. I take it that Python 2.5 is more
sensitive to that than is 2.4? I program almost exclusively in IDLE as
I'd read that this can happen in some text editors, but it seemed
implied that it didn't if you used IDLE. At least, that's what I got
from various Python books and the website:
http://www.python.org/idle/doc/idlemain.html

Anyway, thanks for the help.

Mike
# scrubber.pyw
#
# Author: Mike Driscoll
#
# Updated: 05/16/2007
#
# Deletes folders and files, ignores errors. The deletion functions
# run in a separate thread.


import wx
import os
import glob
import sys
import shutil
import time
import win32api

from threading import Thread

userid = win32api.GetUserName()

class ProfileScrubber(wx.App):
def __init__(self, redirect=True, filename=None):
wx.App.__init__(self, redirect, filename)

def OnInit(self):
self.frame = wx.Frame(None, -1, title='Profile Scrubber Beta 0.3', 
size=(400,500))

panel = wx.Panel(self.frame, -1)

# user list up-to-date as of 10/20/2006
user_list = self.getProfileList()

tempF = r'C:\Documents and Settings\%s\Local Settings\Temp' % userid
tempIntF = r'C:\Documents and Settings\%s\Local Settings\Temporary 
Internet Files' % userid

# Create the controls
descriptionLbl = wx.StaticText(panel, -1, ' Choose an option below:')
font = wx.Font(10, wx.SWISS, wx.NORMAL, wx.BOLD)
descriptionLbl.SetFont(font)
genericPathLbl = wx.StaticText(panel, -1, 'Enter Path:')
self.path = wx.TextCtrl(panel, -1, '', size=(500,-1))

optionLbl = wx.StaticText(panel, -1, 'Other Folders to be Deleted:')
optionLbl.SetFont(font)
self.tempCkbx = wx.CheckBox(panel, -1, 'Temp', size=wx.DefaultSize)
self.tempCkbx.SetValue(True)
self.tempFilesCkbx = wx.CheckBox(panel, -1, 'Temporary Internet Files', 
size=wx.DefaultSize)
self.tempFilesCkbx.SetValue(True)
self.tempTxt = wx.TextCtrl(panel, -1, tempF, size=(500,-1))
self.tempTxt.Disable()
self.tempFilesTxt = wx.TextCtrl(panel, -1, tempIntF, size=(500,-1))
self.tempFilesTxt.Disable()

useridLbl = wx.StaticText(panel, -1, 'Choose the user \n(if 
different):')
self.user = wx.ComboBox(panel, -1, userid, None, (150, -1), user_list, 
wx.CB_DROPDOWN)
self.user.Bind(wx.EVT_COMBOBOX, self.comboChoice)

scrubBtn = wx.Button(panel, -1, 'Scrub')
self.Bind(wx.EVT_BUTTON, self.scrub, scrubBtn)
closeBtn = wx.Button(panel, -1, 'Close')
self.Bind(wx.EVT_BUTTON, self.close, closeBtn)

# create a checklistbox widget to list all the user profiles on the 
machine
profLbl = wx.StaticText(panel, -1, 'Please choose what profiles to 
remove:')
profLbl.SetFont(font)
self.profile_list = self.getProfileList()
self.profile_cblb = wx.CheckListBox(panel, -1, size=(100, -1), 
choices=self.profile_list)

# delete button
deleteBtn = wx.Button(panel, -1, 'Delete Profiles')
self.Bind(wx.EVT_BUTTON, self.deleteProfile, deleteBtn)

# Main sizer to hold all the lesser sizers
mainSizer = wx.BoxSizer(wx.VERTICAL)
mainSizer.Add(descriptionLbl)
mainSizer.Add((10,10))

# pathSizer holds the top set of widgets
pathSizer = wx.FlexGridSizer(cols=2, hgap=5, vgap=5)
pathSizer.AddGrowableCol(1)
pathSizer.Add(genericPathLbl, 0, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL)
pathSizer.Add(self.path, 0, wx.EXPAND)
pathSizer.Add(useridLbl, 0, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL)
pathSizer.Add(self.user, 1)
pathSizer.Add((10,10))

Re: Tabnanny errors when Migrating Python 2.4 code to 2.5

2008-01-04 Thread John Machin
On Jan 5, 3:56 am, [EMAIL PROTECTED] wrote:
 Hi,

 When Python 2.5 first came out, I eagerly downloaded it and
 immediately had issues with getting it to run my 2.4 code. So I just
 stuck to 2.4. However, I decided this week that I really should try to
 get 2.5 to work. Does anyone know why code that works perfectly for
 months in a 2.4 environment throws indentation errors in 2.5?

No, not until you go to the bother of reproducing the problem with a
small file, tell us what platform you are on, how you are running this
code (IDLE, shell prompt, ...), how you installed Python 2.5
(2.5.1?), ...
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tabnanny errors when Migrating Python 2.4 code to 2.5

2008-01-04 Thread kyosohma
On Jan 4, 2:06 pm, John Machin [EMAIL PROTECTED] wrote:
 On Jan 5, 3:56 am, [EMAIL PROTECTED] wrote:

  Hi,

  When Python 2.5 first came out, I eagerly downloaded it and
  immediately had issues with getting it to run my 2.4 code. So I just
  stuck to 2.4. However, I decided this week that I really should try to
  get 2.5 to work. Does anyone know why code that works perfectly for
  months in a 2.4 environment throws indentation errors in 2.5?

 No, not until you go to the bother of reproducing the problem with a
 small file, tell us what platform you are on, how you are running this
 code (IDLE, shell prompt, ...), how you installed Python 2.5
 (2.5.1?), ...


I'm using Windows XP, using IDLE (which was mentioned already) and I
downloaded the 2.5.1 exe/msi file from python.org to install it.

I have yet to find a simple one which exhibits the issue to post. It
seems to happen to my complex files, not the simple ones.

Sorry to bother you.

Mike
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tabnanny errors when Migrating Python 2.4 code to 2.5

2008-01-04 Thread John Machin
On Jan 5, 8:05 am, [EMAIL PROTECTED] wrote:
 On Jan 4, 2:06 pm, John Machin [EMAIL PROTECTED] wrote:

  On Jan 5, 3:56 am, [EMAIL PROTECTED] wrote:

   Hi,

   When Python 2.5 first came out, I eagerly downloaded it and
   immediately had issues with getting it to run my 2.4 code. So I just
   stuck to 2.4. However, I decided this week that I really should try to
   get 2.5 to work. Does anyone know why code that works perfectly for
   months in a 2.4 environment throws indentation errors in 2.5?

  No, not until you go to the bother of reproducing the problem with a
  small file, tell us what platform you are on, how you are running this
  code (IDLE, shell prompt, ...), how you installed Python 2.5
  (2.5.1?), ...

 I'm using Windows XP, using IDLE (which was mentioned already)

in the context of editing/displaying code, not executing it. Does the
problem occur before or after you edit a file with IDLE?

 and I
 downloaded the 2.5.1 exe/msi file from python.org to install it.

What you downloaded doesn't answer the question about how you
installed it. Do you still have your 2.4 installation?


 I have yet to find a simple one which exhibits the issue to post. It
 seems to happen to my complex files, not the simple ones.

So chop up a complex file ...
Have you inspected the failing files using a text editor that can
display tabs and spaces (e.g. PythonWin, TextPad)?


 Sorry to bother you.

You didn't bother me. You are bothering yourself by asking questions
without enough information to get reasonable answers.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tabnanny?

2005-06-08 Thread Douglas Soares de Andrade
Hi Anna !

Please post your code, so we can take a look to see what is happening.

See ya !

Em Quarta 08 Junho 2005 23:36, Anna M. escreveu:
 Hello, i am very new to this.  Only heard of python a week ago and have
 never posted before anywhere.  But I am trying to rewrite a program that I
 made in C++ in Python, a radixSort I did as a school project.  I get a
 Tabnanny Tokenizing Error that says Token Error: EOF in multi-line
 statement.  I gather from the internet that it means I have a tab-error.  I
 just can't seem to find it.  Is this something you can help me with?  Could
 I post my code here and you could look at it or is that a bit to much ;)

 Many thanks,

 Anna

-- 
Douglas Soares de Andrade
http://douglasandrade.cjb.net - dsa at unilestemg.br
UnilesteMG - www.unilestemg.br
ICQ, MSN = 76277921, douglas at tuxfamily.org

-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Tabnanny?

2005-06-08 Thread Anna M.
Thank you so much
and so it goes . . .

from random import randint

def idxLargest(list, n):
idxMx = 0

for i in range(1, n, 1):

if list[i]  list[idxMx]:
idxMx = i

return idxMx


def radixSort(data):
sorting = [data]
tmp = []

for i in range(10):
tmp.append([])

idx = idxLargest(data, len(data)
max = data[idx]
passes = len(max) + 1

for i in range(1, passes + 1, 1):
sorter = tmp

for bucket in sorting:

for next in bucket:
nr = next%(10**i)
radix = (nr/10**(i-1))
sorter[radix].append(next)

sorting = sorter
return sorting

n = 10
a = 0
b = 200
test = []
for i in range(n):
test.append(randint(a,b))

print test
test = radixsort(test)
print test



Hi Anna !

Please post your code, so we can take a look to see what is happening.

See ya !

Em Quarta 08 Junho 2005 23:36, Anna M. escreveu:
 Hello, i am very new to this.  Only heard of python a week ago and have
 never posted before anywhere.  But I am trying to rewrite a program that
I
 made in C++ in Python, a radixSort I did as a school project.  I get a
 Tabnanny Tokenizing Error that says Token Error: EOF in multi-line
 statement.  I gather from the internet that it means I have a tab-error.
I
 just can't seem to find it.  Is this something you can help me with?
Could
 I post my code here and you could look at it or is that a bit to much ;)

 Many thanks,

 Anna

-- 
Douglas Soares de Andrade
http://douglasandrade.cjb.net - dsa at unilestemg.br
UnilesteMG - www.unilestemg.br
ICQ, MSN = 76277921, douglas at tuxfamily.org

-- 
http://mail.python.org/mailman/listinfo/python-list


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tabnanny?

2005-06-08 Thread Douglas Soares de Andrade
Hi Anna !

     idx = idxLargest(data, len(data)

In this line we have a missing ), for me, this was the problem.

Anyway, 

Check this line too:

passes = len(max) + 1

It is giving me an error.

See ya !

-- 
Douglas Soares de Andrade
http://douglasandrade.cjb.net - dsa at unilestemg.br
UnilesteMG - www.unilestemg.br
ICQ, MSN = 76277921, douglas at tuxfamily.org

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tabnanny really useful?

2004-12-21 Thread Franz Steinhaeusler
On Mon, 20 Dec 2004 13:00:39 -0600, John Roth
[EMAIL PROTECTED] wrote:

Tabnanny is intended to check whether indentation
has mixed tabs and spaces. Files with mixed tabs
and spaces _can_ compile just fine if the editor
that produced them agrees with the compiler about
the number of spaces that a tab occupies.

Thanks for your explanation.

I tried an found:
def a():
-print 
-.print

where point is a space.

tabnanny here complains and python compile it just fine.
-- 
Franz Steinhaeusler
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tabnanny really useful?

2004-12-21 Thread Fredrik Lundh
Franz Steinhaeusler wrote:

 Thanks for your explanation.

 I tried an found:
 def a():
 -print
 -.print

 where point is a space.

 tabnanny here complains and python compile it just fine.

really?  that's a syntax error (you cannot change indentation nillywilly
inside a block), and the Python I'm using surely flags this as an error:

$ python -c print repr(open('franz.py').read())
'def a():\n\tprint\n\t print\n'

$ python franz.py
  File franz.py, line 3
print
^
SyntaxError: invalid syntax

while tabnanny gives it one thumb up:

$ python -m tabnanny -v franz.py
'franz.py': Clean bill of health.

what Python version are you using?

/F 



-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tabnanny really useful?

2004-12-21 Thread Franz Steinhaeusler
On Tue, 21 Dec 2004 10:24:40 +0100, Fredrik Lundh
[EMAIL PROTECTED] wrote:

Franz Steinhaeusler wrote:

 Thanks for your explanation.

 I tried an found:
 def a():
 -print
 -.print

 where point is a space.

 tabnanny here complains and python compile it just fine.

really?  that's a syntax error (you cannot change indentation nillywilly
inside a block), and the Python I'm using surely flags this as an error:

$ python -c print repr(open('franz.py').read())
'def a():\n\tprint\n\t print\n'

$ python franz.py
  File franz.py, line 3
print
^
SyntaxError: invalid syntax

while tabnanny gives it one thumb up:

$ python -m tabnanny -v franz.py
'franz.py': Clean bill of health.

what Python version are you using?

/F 



Oh sorry, I meant
def a():
-print
.-print

C:\Python23\Libtabnanny.py -v c:\franz.py
'c:\\franz.py': *** Line 3: trouble in tab city! ***
offending line: ' \tprint\n'
indent not equal e.g. at tab size 1

C:\Python23\Libpython -c print repr(open('c:/franz.py').read())
'def a():\n\tprint\n \tprint\n'

C:\Python23\Libc:/franz.py

C:\Python23\Lib
-- 
Franz Steinhaeusler
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tabnanny really useful?

2004-12-21 Thread Steve Holden
Franz Steinhaeusler wrote:
On Tue, 21 Dec 2004 10:24:40 +0100, Fredrik Lundh
[EMAIL PROTECTED] wrote:

Franz Steinhaeusler wrote:

Thanks for your explanation.
I tried an found:
def a():
-print
-.print
where point is a space.
tabnanny here complains and python compile it just fine.
really?  that's a syntax error (you cannot change indentation nillywilly
inside a block), and the Python I'm using surely flags this as an error:
$ python -c print repr(open('franz.py').read())
'def a():\n\tprint\n\t print\n'
$ python franz.py
File franz.py, line 3
  print
  ^
SyntaxError: invalid syntax
while tabnanny gives it one thumb up:
$ python -m tabnanny -v franz.py
'franz.py': Clean bill of health.
what Python version are you using?
/F 



Oh sorry, I meant
def a():
-print
..-print
C:\Python23\Libtabnanny.py -v c:\franz.py
'c:\\franz.py': *** Line 3: trouble in tab city! ***
offending line: ' \tprint\n'
indent not equal e.g. at tab size 1
C:\Python23\Libpython -c print repr(open('c:/franz.py').read())
'def a():\n\tprint\n \tprint\n'
C:\Python23\Libc:/franz.py
C:\Python23\Lib
Well, you've probably answered your own question, then. Do you think 
tabnanny is a useful piece of code now? I used it a lot when I first 
started using Python, and still run it over code from unknown sources 
(no pun intended) from time to time.

regards
 Steve
--
Steve Holden   http://www.holdenweb.com/
Python Web Programming  http://pydish.holdenweb.com/
Holden Web LLC  +1 703 861 4237  +1 800 494 3119
--
http://mail.python.org/mailman/listinfo/python-list


Re: Tabnanny really useful?

2004-12-21 Thread Franz Steinhaeusler
On Tue, 21 Dec 2004 08:36:31 -0500, Steve Holden [EMAIL PROTECTED]
wrote:

Franz Steinhaeusler wrote:

[...]
 
 Oh sorry, I meant
 def a():
 -print
 ..-print
 
 C:\Python23\Libtabnanny.py -v c:\franz.py
 'c:\\franz.py': *** Line 3: trouble in tab city! ***
 offending line: ' \tprint\n'
 indent not equal e.g. at tab size 1
 
 C:\Python23\Libpython -c print repr(open('c:/franz.py').read())
 'def a():\n\tprint\n \tprint\n'
 
 C:\Python23\Libc:/franz.py
 
 C:\Python23\Lib

Well, you've probably answered your own question, then. Do you think 
tabnanny is a useful piece of code now? 

Not really soo useful, because most syntax and also indentation errors
are actually detected by invoking python, i.e. the command compile.
But as combination for this: yes why not.
I looked for Stanis spe editor, which uses a combination of these two.

The background is:

I'm a member of the wxPython project Drpython (Python text editor 
and much more), and wanted also check the usefulness of a kind of syntax
check, which should run, before saving a Python file.
PythonCard Codeeditor also uses tabnanny, as far as i can remember.

[...]

regards
-- 
Franz Steinhaeusler
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tabnanny really useful?

2004-12-21 Thread Steve Holden
Franz Steinhaeusler wrote:
On Tue, 21 Dec 2004 08:36:31 -0500, Steve Holden [EMAIL PROTECTED]
wrote:

Franz Steinhaeusler wrote:
[...]
Oh sorry, I meant
def a():
-print
..-print
C:\Python23\Libtabnanny.py -v c:\franz.py
'c:\\franz.py': *** Line 3: trouble in tab city! ***
offending line: ' \tprint\n'
indent not equal e.g. at tab size 1
C:\Python23\Libpython -c print repr(open('c:/franz.py').read())
'def a():\n\tprint\n \tprint\n'
C:\Python23\Libc:/franz.py
C:\Python23\Lib
Well, you've probably answered your own question, then. Do you think 
tabnanny is a useful piece of code now? 

Not really soo useful, because most syntax and also indentation errors
are actually detected by invoking python, i.e. the command compile.
But as combination for this: yes why not.
I looked for Stanis spe editor, which uses a combination of these two.
The background is:
I'm a member of the wxPython project Drpython (Python text editor 
and much more), and wanted also check the usefulness of a kind of syntax
check, which should run, before saving a Python file.
PythonCard Codeeditor also uses tabnanny, as far as i can remember.


[...]

regards
I've used drpython, and liked it. I think it would be a good way for 
people to start to use the language, as it avoids the just the command 
line syndrome without being as complex as IDLE or PythonWin. In short, 
just about right for a beginner.

regards
 Steve
--
Steve Holden   http://www.holdenweb.com/
Python Web Programming  http://pydish.holdenweb.com/
Holden Web LLC  +1 703 861 4237  +1 800 494 3119
--
http://mail.python.org/mailman/listinfo/python-list


Re: Tabnanny really useful?

2004-12-21 Thread Franz Steinhaeusler
On Tue, 21 Dec 2004 09:34:47 -0500, Steve Holden [EMAIL PROTECTED]
wrote:


Hello Steve,

I've used drpython, and liked it. 

thank you, I'm sure, our project Admin will be pleased to hear this :)

I think it would be a good way for 
people to start to use the language, 

yes, this project is intended to fulfill this purpose.

as it avoids the just the command 
line syndrome without being as complex as IDLE or PythonWin. 

I think, it isn't too far away from these two anymore ;)
Considering the expansion with scripts and plugins,
and there are a several of them available.

In short, 
just about right for a beginner.

I use it exclusively for a few months for any Python source editing.


regards
  Steve

regards,
-- 
Franz Steinhaeusler
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tabnanny really useful?

2004-12-21 Thread John Roth
Steve Holden [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]

Do you think tabnanny is a useful piece of code now? I used it a lot when 
I first started using Python, and still run it over code from unknown 
sources (no pun intended) from time to time.
I think it's a lot less useful today than it was a few
years ago, but it's still useful if you're stuck with an
editor that doesn't give you a robust set of options,
or if you've got to check a lot of modules in a library.
I think most python-aware editors have included
the needed functionality, or at least some reasonable
approximation.
I know what I would like to see in an editor:
First, it autodetects whether the module uses
tabs consistently, spaces consistently or a
mixture. If it uses tabs consistently, it then
uses the current default.
If it uses spaces consistently, it should also
autodetect the indentation setting in use in
the module and offer to change it if it's
different from the current default indentation
setting.
If it's inconsistent, it should make an attempt
to deduce the model the creating software
used; if it can it should change it to the
default setting without complaining. Otherwise
it should complain.
John Roth
regards
 Steve
--
Steve Holden   http://www.holdenweb.com/
Python Web Programming  http://pydish.holdenweb.com/
Holden Web LLC  +1 703 861 4237  +1 800 494 3119 
--
http://mail.python.org/mailman/listinfo/python-list


Re: Tabnanny really useful?

2004-12-21 Thread Steve Holden
John Roth wrote:
[...]
I know what I would like to see in an editor:
First, it autodetects whether the module uses
tabs consistently, spaces consistently or a
mixture. If it uses tabs consistently, it then
uses the current default.
If it uses spaces consistently, it should also
autodetect the indentation setting in use in
the module and offer to change it if it's
different from the current default indentation
setting.
If it's inconsistent, it should make an attempt
to deduce the model the creating software
used; if it can it should change it to the
default setting without complaining. Otherwise
it should complain.
John Roth
Sounds like WingIDE to me. I'm a recent convert, but one feature that 
impressed me was the instant warning I got when I indented code with 
spaces in a tab-oriented source file.

regards
 Steve
--
Steve Holden   http://www.holdenweb.com/
Python Web Programming  http://pydish.holdenweb.com/
Holden Web LLC  +1 703 861 4237  +1 800 494 3119
--
http://mail.python.org/mailman/listinfo/python-list


Re: Tabnanny really useful?

2004-12-21 Thread Franz Steinhaeusler
On Tue, 21 Dec 2004 09:06:12 -0600, John Roth
[EMAIL PROTECTED] wrote:


Steve Holden [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]

 Do you think tabnanny is a useful piece of code now? I used it a lot when 
 I first started using Python, and still run it over code from unknown 
 sources (no pun intended) from time to time.

I think it's a lot less useful today than it was a few
years ago, but it's still useful if you're stuck with an
editor that doesn't give you a robust set of options,
or if you've got to check a lot of modules in a library.

I think most python-aware editors have included
the needed functionality, or at least some reasonable
approximation.

I know what I would like to see in an editor:

First, it autodetects whether the module uses
tabs consistently, spaces consistently or a
mixture. If it uses tabs consistently, it then
uses the current default.


If it uses spaces consistently, it should also
autodetect the indentation setting in use in
the module and offer to change it if it's
different from the current default indentation
setting.

If it's inconsistent, it should make an attempt
to deduce the model the creating software
used; if it can it should change it to the
default setting without complaining. Otherwise
it should complain.


Again, DrPython does this almost as you described ;)

There is an option in the preferences:
Use File's Indentation

and the indent setttings are set to the one,
what is found in the opened source file.

In the status line, the mode SPACES or TABS or
MIXED is displayed.

There are also the functions:
Edit=Whitespace=Check Indentation
Edit=Whitespace=Set Indentation to spaces 
(replaces all tabs with the preset nr of spaces for tab

Exception 1:
 (it could set then the tab mode to spaces)
and respectively:
Edit=Whitespace=Set Indentation to spaces 

Exception 2:

If open a file, there could be a check, whether 
tabs and spaces indentations are mixed, try to correct
if possible or complain (let the user decide).

= Feature Request ;)

regards,
-- 
Franz Steinhaeusler
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tabnanny really useful?

2004-12-21 Thread Yet Another Mike
I'm told Tabnanny was inspired by lint, the Unix utiltity to check C sources 
(and probably others).  Lint was primarily useful in days long ago when CPUs 
were slow and a compile used a significant amount of resources. In a 
multiuser environment (we ran an Intel 286 in multiuser mode!!), the 
compiles could bring everyone else to a crawl. Lint was used because it was 
a less-CPU intensive way to catch bonehead errors and fix them before using 
precious compile time.

Today,lint and Tabnanny may still have their uses as noted by others to 
cleanup the tab/space conundrum.
-- 
Mike

Franz Steinhaeusler [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi, I looked at tabnanny to check
 a python source file.

 But I didn't find anything, tabnanny
 is able to find, what couldn't be found
 by compile command.

 Or have I missed something?

 best regards,
 -- 
 Franz Steinhaeusler 


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tabnanny really useful?

2004-12-21 Thread Mike Meyer
Yet Another Mike [EMAIL PROTECTED] writes:

 I'm told Tabnanny was inspired by lint, the Unix utiltity to check C sources 
 (and probably others).  Lint was primarily useful in days long ago when CPUs 
 were slow and a compile used a significant amount of resources. In a 
 multiuser environment (we ran an Intel 286 in multiuser mode!!), the 
 compiles could bring everyone else to a crawl. Lint was used because it was 
 a less-CPU intensive way to catch bonehead errors and fix them before using 
 precious compile time.

Originally, lint caught errors the C compiler didn't flag as
errors. For example:

int *main = { . } ;

The C compiler would build and link that just fine on v7. lint would
complain about it. Of course, if you used the right ints to fill the
array, it would produce a valid executable.

   mike
-- 
Mike Meyer [EMAIL PROTECTED]  http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Tabnanny really useful?

2004-12-20 Thread John Roth
Franz Steinhaeusler [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
Hi, I looked at tabnanny to check
a python source file.
But I didn't find anything, tabnanny
is able to find, what couldn't be found
by compile command.
Or have I missed something?
Tabnanny is intended to check whether indentation
has mixed tabs and spaces. Files with mixed tabs
and spaces _can_ compile just fine if the editor
that produced them agrees with the compiler about
the number of spaces that a tab occupies.
On the other hand, such files are quite likely to
be messed up almost beyond repair if one tries
to edit them in an editor that treats tabs differently
from the one that produced it.
Files that stick to one or the other can always
be edited and compiled properly. The python
recommendation is to use spaces, but not
everyone agrees with this.
Most modern Python-aware editors handle
the situation reasonably, although you may have
to set parameters.
John Roth
best regards,
--
Franz Steinhaeusler 
--
http://mail.python.org/mailman/listinfo/python-list