Skip to content

octal constants shouldn't be  #20

@CarlFK

Description

@CarlFK

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions