[Python-bugs-list] [ python-Bugs-522274 ] compiler/transformer.py STARSTAR doesn't exist

noreply@sourceforge.net noreply@sourceforge.net
Fri, 19 Apr 2002 15:59:34 -0700


Bugs item #522274, was opened at 2002-02-25 01:40
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=522274&group_id=5470

Category: Parser/Compiler
Group: Python 2.2
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Evelyn Mitchell (efm)
Assigned to: Jeremy Hylton (jhylton)
Summary: compiler/transformer.py STARSTAR doesn't exist

Initial Comment:
pyChecker complains at line 774 of tokenizer.py
No module attribute (STARSTAR) found

The section is:

                if i < len(nodelist):
                    # should be DOUBLESTAR or STAR STAR
                    t = nodelist[i][0]
                    if t == token.DOUBLESTAR:
                        node = nodelist[i+1]
                    elif t == token.STARSTAR:
                        node = nodelist[i+2]
                    else:
                        raise ValueError, "unexpected
token: %s" % t
                    names.append(node[1])
                    flags = flags | CO_VARKEYWORDS

I've verified that there is no STARSTAR in token.py.
I'd patch this to be token.STAR, which does exist, but
this module has no self tests or unit tests, so I
wouldn't be able to know if it broke anything.

My wild guess is that the intention is to refer to two
STAR tokens rather than a DOUBLESTAR token (and that is
because the increment is 2 rather than 1), but I think
that evidence is pretty slim.

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

>Comment By: Jeremy Hylton (jhylton)
Date: 2002-04-19 22:59

Message:
Logged In: YES 
user_id=31392

Fixed in rev 1.33 of transformer.py
and in rev 1.80.8.1.2.1 (release22-maint branch).
Not present in earlier versions.


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

Comment By: Guido van Rossum (gvanrossum)
Date: 2002-03-16 19:21

Message:
Logged In: YES 
user_id=6380

I think the STARSTAR should be STAR.  Jeremy, can you
confirm & fix? Also, there needs to be a unittest for this
code, apparently!

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

Comment By: Evelyn Mitchell (efm)
Date: 2002-03-16 16:18

Message:
Logged In: YES 
user_id=13263

Sorry, too much caffine. 

The file is compiler/transformer.py

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

Comment By: Just van Rossum (jvr)
Date: 2002-03-10 18:48

Message:
Logged In: YES 
user_id=92689

I don't see a file "tokenizer.py" in the repository, only 
"tokenize.py", which only has 262 lines. What is this 
bug about?

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

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