On Thursday 18 February 2010 11:21:55 Sylvain Thénault wrote:
> > I guess, you should actually add a *visit_assert* and check the type
> > of 'test' :
> >
> >     def visit_assert(self, node):
> >         if isinstance(node.test, astng.Tuple):
> >        that_s_bad()
>
> that's not enough, we should ensure that
>
>  raise (a, b), 'bad'
>
> don't trigger the message
>

I thought, we are talking about *assert*, not *raise* ?
And shouldn't 

  assert (a, b), bad_msg

trigger the message too ?
the tuple goes into assert_node.test, the 'bad' into assert_node.fail;
here is the tree:

Module()
    body = [
    Assert()
        test = 
        Tuple(tuple)
            elts = [
            Name(a)
            Name(b)
            ]
        fail = 
        Name(bad_msg)
    ]

--

Emile Anclin <emile.anc...@logilab.fr>
http://www.logilab.fr/   http://www.logilab.org/ 
Informatique scientifique & et gestion de connaissances
_______________________________________________
Python-Projects mailing list
Python-Projects@lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects

Reply via email to