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.

current init breaks `import returns` usecase

See original GitHub issue
(crypy-PletnYfd)alexv@pop-os:~/Projects/crypy$ python3
Python 3.7.2 (default, Jan  8 2019, 16:12:09) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import returns
>>> returns.result
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'returns' has no attribute 'result'
>>> returns.__file__
'/home/alexv/.local/share/virtualenvs/crypy-PletnYfd/lib/python3.7/site-packages/returns/__init__.py'
>>> returns.__version__
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'returns' has no attribute '__version__'

I believe __init__.py should contain the modules or not be there at all, for both usecases to work. The usage given in example from returns.result import Result works because python import finds result.py as part of the package, but the module is not loaded as part of the super/parent package.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
sobolevncommented, May 22, 2019

Ok, let’s expose public API in returns module.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python lib breaks on import · Issue #6567 · tensorflow/tfjs · GitHub
Describe the current behavior when I import the python converter lib with import tensorflowjs as tjs it throws this: Traceback (most recent call...
Read more >
Should import statements always be at the top of a module?
I just want to mention one use case when I find especially useful to import modules inside functions. My application uses python packages...
Read more >
What Happens When You Import Lines to Negotiations by ...
The table shows the different fields available in the import lines spreadsheet. It explains which fields are used with which negotiation type and...
Read more >
PH25205: MIGRATION FROM 502->6061 FOLLOWED BY EXPORT ...
Migration from 502->6061 followed by export/import breaks IBM Rational Quality Manager (RQM) queries. Steps to reproduce : 1.
Read more >
Understand Dynamic Importing in JavaScript
To dynamically import a module, we need to use import keyword as a function. When used as a function, this will return a...
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