[issue7396] regrtest single: iterator not subscriptable

2009-12-16 Thread R. David Murray

R. David Murray  added the comment:

Thanks for testing.  Note that you don't need to use -s to run a single
test.  You can specify a list of tests to run on the regrtest command
line, which can be just one test.  -s for running all the tests one at a
time so that you restart the interpreter between each one (ie: when
using -s you issue the regrtest -s command multiple times...)

Committed to trunk in r76856 and py3k in r76857.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7396] regrtest single: iterator not subscriptable

2009-12-15 Thread James G. sack (jim)

James G. sack (jim)  added the comment:

Update: I was doing something wrong and getting false failures. 

I forgot to do ./configure and make after major revision-switches so the 
failures I was seeing in bz2 and codecs (and others, :-[ ) was bogus.

Repeating the main message, though:
 The regrtest patch seems ok

~jim

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7396] regrtest single: iterator not subscriptable

2009-12-15 Thread James G. sack (jim)

James G. sack (jim)  added the comment:

Thanks, it seems to work now. 

My test method uses the command format
  ./python -Ebb Lib/test/regrtest.py -s test_calendar

Sorry for the delayed response, I discovered problems with 
  test_bz2
  test_codecs
which I wanted to confirm was real rather than my test procedure.

~jim

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7396] regrtest single: iterator not subscriptable

2009-12-12 Thread R. David Murray

R. David Murray  added the comment:

Yes, rebinding a variable to a different type is something that is
considered an acceptable pattern in Python programs, at least in certain
circumstances.  Python programs generally use 'duck typing', and a list
and an iterable have equivalent semantics for the purposes of (most of)
the regrtest code.

On the other hand, regrtest is in general *not* an example of good
Python code, and really ought to be cleaned up at some point.  In
particular, the code blocks in regrtest are simply huge, and this makes
changing it very error prone, with "what type is this variable" being
just one example of the coupling problems.

Attached is a patch against trunk.  Please confirm that this fixes the
problems you found.

--
assignee:  -> r.david.murray
components: +Tests
keywords: +patch
stage:  -> patch review
versions:  -Python 2.6, Python 3.1
Added file: http://bugs.python.org/file15532/regrtest_single_issue7396.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7396] regrtest single: iterator not subscriptable

2009-12-12 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +michael.foord, ncoghlan, pitrou, r.david.murray
priority:  -> normal
versions:  -Python 3.0

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7396] regrtest single: iterator not subscriptable

2009-11-25 Thread James G. sack (jim)

New submission from James G. sack (jim) :

file Lib/tests/regrtest.py
 
Evidently rev 76260 (trunk) / 76261 (py3k)
broke code at
  rev 76324 line 655 (py3k)
  rev 76321 line 620 (trunk) 
which is
   if tests[0] == alltests[i]  
because tests was rebound from a list to an iterable, and hence indexing 
cannot be performed on tests subsequent to the rebinding.

There are a few other places where tests is indexed, but I suspect those 
places are before the rebinding to an iterable.

At first glance, a viable patch might be to use a different name, eg 
itests, and leave the original tests list available for use by the line 
causing the TypeError. However, I think someone more knowledgeable needs 
to have a look.

Ummm, forgive me if this is offbase, but would it be fair to identify as 
a bad practice, the rebinding of a variable to a different type. 

~jim

--
messages: 95731
nosy: jgsack
severity: normal
status: open
title: regrtest single: iterator not subscriptable
type: behavior
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1, Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com