Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leading space results in IndentationError #17

Closed
iivvoo opened this issue Oct 30, 2016 · 1 comment
Closed

Leading space results in IndentationError #17

iivvoo opened this issue Oct 30, 2016 · 1 comment

Comments

@iivvoo
Copy link

iivvoo commented Oct 30, 2016

I'm using simpleeval for evaluating template expressions, e.g.

{{ foo.bar }}

Because the engine (https://github.com/iivvoo/ate if anyone's interested ;) aims to be user (programmer) friendly it ignores leading/trailing whitespaces and passes them verbatim to simpleeval which sometimes results in an IndentationError

In [1]: from simpleeval import simple_eval
In [2]: simple_eval(" True")
  File "<unknown>", line 1
    True
    ^
IndentationError: unexpected indent

This is quite simple to work around but it makes me wonder if there's any need at all for simpleeval to be so strict about whitespace - is any form of indentation actually supported?

@danthedeckie
Copy link
Owner

No, you're quite right. No indentation is supported at all. :-)
So it now strips it, as of: e0347ba
Is that all working for you now?
If no one complains, I'll close this next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants