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:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, let’s expose public API in
returns
module.Closed by https://github.com/dry-python/returns/commit/4e9ab7bd856b9af679a176df7a18b2f40d917dd4