Sandra-24 wrote:
> I'm not sure how complex this is, I've been brainstorming a little, and
> I've come up with:
from tokenize import generate_tokens, NL, NEWLINE
from cStringIO import StringIO
def code_lines(source):
"""Takes Python source code (as either a string or file-like
object) a
Sandra-24 wrote:
> I'm not sure how complex this is, I've been brainstorming a little, and
> I've come up with:
>
> If the previous line ended with a comma or a \ (before an optional
> comment)
>
> That's easy to cover with a regex
>
> But that doesn't cover everything, because this is legal:
>
Sandra-24 wrote:
> No it's not an academic excercise, but your right, the situation is
> more complex than I originally thought. I've got a minor bug in my
> template code, but it'd cause more trouble to fix than to leave in for
> the moment.
>
> Thanks for your input!
> -Sandra
>
Take a look at
No it's not an academic excercise, but your right, the situation is
more complex than I originally thought. I've got a minor bug in my
template code, but it'd cause more trouble to fix than to leave in for
the moment.
Thanks for your input!
-Sandra
--
http://mail.python.org/mailman/listinfo/pyth
On 8 Apr 2006 11:24:04 -0700,
"Sandra-24" <[EMAIL PROTECTED]> wrote:
> I'm not sure how complex this is, I've been brainstorming a little, and
> I've come up with:
["This" meaning how to determine if a line of python code is a
continuation of th
I'm not sure how complex this is, I've been brainstorming a little, and
I've come up with:
If the previous line ended with a comma or a \ (before an optional
comment)
That's easy to cover with a regex
But that doesn't cover everything, because this is legal:
l = [
1,
2,
3
]