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

__slots__? #47

Closed
vaneseltine opened this issue Sep 23, 2019 · 2 comments
Closed

__slots__? #47

vaneseltine opened this issue Sep 23, 2019 · 2 comments

Comments

@vaneseltine
Copy link
Owner

https://docs.python.org/3/reference/datamodel.html
https://stackoverflow.com/questions/472000/usage-of-slots

@vaneseltine
Copy link
Owner Author

@vaneseltine
Copy link
Owner Author

Makes essentially no difference but doesn't hurt to have.

import timeit
from nominally import Name

test_name = "Blidge, Dr. Janifev (Mucky) J. M.D. Junior"

stmt = """
name = Name("{test_name}")
d = dict(name)
s = str(name)
name.first
name.cleaned
"""

print(timeit.timeit(stmt=stmt, setup="from nominally import Name", number=10000))


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

No branches or pull requests

1 participant