Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable import * by adding __all__ #153

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pacrob
Copy link
Contributor

@pacrob pacrob commented Jan 18, 2025

What was wrong?

Lazy loading made from py_ecc import * not work.

How was it fixed?

Adding an __all__ to the top level __init__.py makes it work again.

# before

Python 3.13.1 (main, Jan  7 2025, 15:30:30) [GCC 11.4.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.31.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: %time import py_ecc
CPU times: user 5.98 ms, sys: 0 ns, total: 5.98 ms
Wall time: 5.21 ms

In [2]: %time from py_ecc import *
CPU times: user 34 μs, sys: 2 μs, total: 36 μs
Wall time: 40.1 μs

# after

Python 3.13.1 (main, Jan  7 2025, 15:30:30) [GCC 11.4.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.31.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: %time import py_ecc
CPU times: user 4.4 ms, sys: 2.74 ms, total: 7.14 ms
Wall time: 6.16 ms

In [2]: %time from py_ecc import *
CPU times: user 546 ms, sys: 11.1 ms, total: 557 ms
Wall time: 556 ms

Todo:

  • Clean up commit history
  • Add or update documentation related to these changes
  • Add entry to the release notes

Cute Animal Picture

image

@pacrob pacrob force-pushed the enable-import-star branch from ef3cb1a to 6b18467 Compare January 18, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant