Browse Source

🎨 Make __init__.py imports simpler

- Remove unnecessary comment about signals section
- Import jsonify in a single line
pull/2849/head
Gabriel Saldanha 7 years ago
parent
commit
7efd745970
  1. 11
      flask/__init__.py

11
flask/__init__.py

@ -29,20 +29,13 @@ from .ctx import has_request_context, has_app_context, \
after_this_request, copy_current_request_context
from .blueprints import Blueprint
from .templating import render_template, render_template_string
# the signals
from .signals import signals_available, template_rendered, request_started, \
request_finished, got_request_exception, request_tearing_down, \
appcontext_tearing_down, appcontext_pushed, \
appcontext_popped, message_flashed, before_render_template
# We're not exposing the actual json module but a convenient wrapper around
# it.
from . import json
# This was the only thing that Flask used to export at one point and it had
# a more generic name.
jsonify = json.jsonify
# Expose a convenient wrapper around python's builtin json module.
from .json import jsonify
# backwards compat, goes away in 1.0
from .sessions import SecureCookieSession as Session

Loading…
Cancel
Save