[ python-Bugs-1441408 ] svn head compiler fails to spot extended slicing

SourceForge.net noreply at sourceforge.net
Fri Mar 17 19:04:23 CET 2006


Bugs item #1441408, was opened at 2006-03-02 11:20
Message generated for change (Comment added) made by ncoghlan
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1441408&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Parser/Compiler
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Michael Hudson (mwh)
Assigned to: Nobody/Anonymous (nobody)
Summary: svn head compiler fails to spot extended slicing

Initial Comment:
This is Python SVN HEAD:

>>> dis.dis(compile("x[::]", '', 'single'))
  1           0 LOAD_NAME                0 (x)
              3 SLICE+0             
              4 PRINT_EXPR          
              5 LOAD_CONST               0 (None)
              8 RETURN_VALUE        

This is Python 2.4:

>>> dis.dis(compile("x[::]", '', 'single'))
  1           0 LOAD_NAME                0 (x)
              3 LOAD_CONST               0 (None)
              6 LOAD_CONST               0 (None)
              9 LOAD_CONST               0 (None)
             12 BUILD_SLICE              3
             15 BINARY_SUBSCR       
             16 PRINT_EXPR          
             17 LOAD_CONST               0 (None)
             20 RETURN_VALUE        


----------------------------------------------------------------------

>Comment By: Nick Coghlan (ncoghlan)
Date: 2006-03-18 04:04

Message:
Logged In: YES 
user_id=1038590

Applied 1452332 to SVN (generates an explicit None reference
for the step when the second colon is present but no
expressions is supplied for the step)

----------------------------------------------------------------------

Comment By: Nick Coghlan (ncoghlan)
Date: 2006-03-17 23:45

Message:
Logged In: YES 
user_id=1038590

Alternate patch that doesn't modify the AST posted as 1452332

----------------------------------------------------------------------

Comment By: Grant Olson (logistix)
Date: 2006-03-10 10:22

Message:
Logged In: YES 
user_id=699438

Patch 1446847 Posted.

----------------------------------------------------------------------

Comment By: Grant Olson (logistix)
Date: 2006-03-06 09:33

Message:
Logged In: YES 
user_id=699438

This only happens when you have implicit slice values. 
x[1:2:3] works fine.  I'm finishing up a patch and will post
to sf shortly.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1441408&group_id=5470


More information about the Python-bugs-list mailing list