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

octal constants shouldn't be #20

Open
CarlFK opened this issue Jun 18, 2016 · 0 comments
Open

octal constants shouldn't be #20

CarlFK opened this issue Jun 18, 2016 · 0 comments

Comments

@CarlFK
Copy link
Contributor

CarlFK commented Jun 18, 2016

expected_date = datetime.date(year, 05, 03)
https://github.com/dabodev/dabo/blob/master/dabo/lib/test/test_dates.py#L17

Did you know that 05 is the octal notation for 5? Neither did I.

In python 2 it doesn't matter, but in py3 the syntax changed and now 05 causes problems, so may as well fix it (pr coming)

the py3 issues: 05 is a syntax error:

>>> 05
  File "<console>", line 1
    05
     ^
SyntaxError: invalid token

(veyepar) carl@twist:~/src/dabo/dabo/lib/test$ 2to3 test_dates.py

  •   expected_date = datetime.date(year, 0o5, 0o3)
    

That's 'ok' but not really.

EdLeafe added a commit that referenced this issue Jun 21, 2016
change 05 to 5 and other 0n constants, fixes #20
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

1 participant