Skip to content

ignoring errors not working (# type: ignore) #6410

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

Closed
squarewave24 opened this issue Feb 15, 2019 · 3 comments
Closed

ignoring errors not working (# type: ignore) #6410

squarewave24 opened this issue Feb 15, 2019 · 3 comments

Comments

@squarewave24
Copy link

squarewave24 commented Feb 15, 2019

I searched through existing issues, and saw the # type: ignore method, but doesn't seem to work:

from flask import Flask  # type: ignore

app = Flask(__name__)

log = config.configure_logging(app)
log.info('Starting Flask Demo with environment {0}'.format(config.ENVIRONMENT))
app.config.from_object(config)
app.config.from_envvar('APP_SETTINGS', silent=True)

app.config.from_object(config)
app.config.from_envvar('APP_SETTINGS', silent=True)

api/app.py:22: error: "Dict[str, Any]" has no attribute "from_object"
api/app.py:23: error: "Dict[str, Any]" has no attribute "from_envvar"

MyPy Version: 0.670

@ilevkivskyi
Copy link
Member

  1. This is a typeshed issue, not mypy issue
  2. It is already fixed in typeshed, wait for next release
  3. # type: ignore should be put on the line where error appears.

@squarewave24
Copy link
Author

squarewave24 commented Feb 15, 2019

thanks that worked,

btw: this was the referenced thread, and # type ignore is on the import

#500

Gerschtli added a commit to Gerschtli/betting-game-backend that referenced this issue Mar 10, 2019
@abij
Copy link

abij commented Jun 11, 2020

Note its# type: ignore (with the colon) as described in PEP-484

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

3 participants