Comments (7)
I think it would be reasonable to warn about deprecation in 0.x and deprecate in 1.0 as long as it's done well and an upgrade guide for 0.x to 1.0 is provided.
from werkzeug.
I think we still could autogenerate __all__
from globals()
. The repetition is otherwise just too heavy IMO.
from werkzeug.
@mitsuhiko this issue only mentions removing the magic, and I'm assuming leaving the top-level imports. However, the docs have said for quite some time that the top-level imports will be removed completely and users should use specific imports: http://werkzeug.palletsprojects.com/en/0.15.x/transition/#automatically-rewriting-imports
I think using specific imports is preferable, and would like to phase out the top-level, but this has been open for 8.5 years now. Any opinion on what should happen? Basically, do we just remove the magic, or do we also remove the top-level imports?
from werkzeug.
With the current magic, PyCharm (and possibly other IDEs) has no idea what's going on and so it always uses specific imports. Removing the magic will make it more likely that users will import from the top-level because it will become more discoverable.
The top-level imports are somewhat haphazard as well. Perhaps a compromise would be a reduced set of just the common entry points into Werkzeug (Request, Response, Client, run_simple, etc.)
from werkzeug.
I somehow feel like changing this now will be super frustrating to users. I think at least we should not remove it with 1.0 but we could deprecate them with 1.0 (with a warning) and then remove them with 2.0.
from werkzeug.
The only problem with putting off removal until 2.0 is that there's no definite time when that happens. The deprecation warning would be around for a long time. We had this issue with Flask-SQLAlchemy, where a deprecation warning has been bugging people for years, although admittedly I handled that less well by making it visible by default instead of only during tests.
from werkzeug.
from werkzeug.
Related Issues (20)
- docs: update urlparse import
- test.Client is incorrectly using isinstance check instead of issubclass
- Request not closed with Unicode characters in headers
- Double slashes aren't being handled correctly
- send_file does not include mimetype .webp images HOT 2
- `Rule.endpoint` type annotation doesn't comply with the documentation
- werkzeug > 2.2.2 throws WinError 10038 during flask debug app reload HOT 2
- ProxyFix with x_port should skip standard 80 or 443 ports HOT 6
- `pyright` in strict mode errors when using `formparser.MultiPartParser.parse`
- MultiDict does not handle None values HOT 1
- Test regression with pytest-8.0.0: `tests/test_exceptions.py::test_response_body[RequestRedirect]` HOT 2
- Add "421 Misdirected Request" http exception
- Update runtime dependencies HOT 1
- Random "ssl.SSLEOFError: EOF occurred in violation of protocol" when handling HTTP 206 HOT 2
- OSError: [WinError 10038] An operation was attempted on something that is not a socket HOT 2
- `FileStorage.name` should be the filename HOT 2
- Use of Python 2 `print` statement in quickstart docs
- Handle AssertionError for fkask-socketio HOT 2
- BaseWSGIServer: throw exception on bind failure rather than calling sys.exit() HOT 4
- TLS connection not properly closed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from werkzeug.