question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

import bottle.ext... not pythonic

See original GitHub issue

example:

from bottle.ext import sqlalchemy

It is not very pythonic, we are bringing spells (not leaving explicit where the package comes from).

This python:

...
Explicit is better than implicit.
...

What’s your opinions?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
PyB1lcommented, May 5, 2018

I think that explicit import is the best way to go for many reasons. Although I believe that python “magic” could work in some scenarios to provide a nice API, in this case i agree that explicit import in this case is better. For instance:

  1. New (python) users that chose bottle.py for a single project for it’s simplicity should not have to deal with this.

  2. Decouple from package management: Instead of

from bottle.ext.jwt import JWTPLugin the equilevant

from bottle_jwt import JWTPlugin

is more clear. Image the confusion with two different plugins with similar name conventions.

0reactions
avelinocommented, May 5, 2018

@defnull what you opinion?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Command Line Interface: bottle.ext ImportError #334 - GitHub
To reproduce the issue: Install a virtual environment: $ virtualenv --no-site-packages venv $ venv/bin/pip install bottle bottle-sqlalchemy ...
Read more >
Tutorial — Bottle 0.13-dev documentation
Bottle returns strings as a whole (instead of iterating over each char) and adds a Content-Length header based on the string length. Lists...
Read more >
Unable to import a package in Python - Stack Overflow
I am using Python 3.8.6 with pipenv. The commands I runned were the following: pipenv shell pipenv install bottle. The code in the...
Read more >
How to use the bottle.Bottle function in bottle - Snyk
Use Snyk Code to scan source code in minutes - no build needed - and fix issues ... #!/usr/bin/python from bottle import run,route,app,request,response ......
Read more >
Bottle - Read the Docs
Templates: Fast and pythonic built-in template engine and support for mako, jinja2 and cheetah ... Bottle does not depend on any external libraries....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found