Skip to content

py2 pytz.UTC issue #710

@snakescott

Description

@snakescott

Code:

from datetime import datetime
from pytz import UTC

print datetime.utcnow().replace(tzinfo=UTC)

Invocaton:

/Users/jhscott/.virtualenvs/mypy3/bin/mypy --fast-parser --silent-imports  --py2 mypy_bug.py
mypy_bug.py:4: error: Argument 1 to "replace" of "datetime" has incompatible type "UTC"; expected "Union[tzinfo, bool]"

Environment

(mypy_foo)➜  mypy_foo /Users/jhscott/.virtualenvs/mypy3/bin/python -m pip freeze
lxml==3.6.4
mypy-lang==0.4.6
typed-ast==0.6.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions