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

Feature: Real decorator support for namespace aliases #16

Open
arizvisa opened this issue Sep 23, 2018 · 2 comments
Open

Feature: Real decorator support for namespace aliases #16

arizvisa opened this issue Sep 23, 2018 · 2 comments

Comments

@arizvisa
Copy link
Owner

arizvisa commented Sep 23, 2018

Right now only function aliases are supported via internal.utils.alias. Aliases for namespaces (database.integer aliased as database.i, database.entries aliased as database.exports, database.address as database.a, or database.type as database.t, etc.) are implemented by (straight-up) assigning the namespace to the target alias variable. This has negative effects with things such as help() since due to more than one variable being assigned for the same class, the documentation for the class is listed multiple times.

It'd be nice to do something similar to internal.utils.alias, but rather for namespaces so that way the help() for the namespace alias can simply be a reference to the real namespace. Then the reStructuredText generator in docs/docparse.py within the docs branch can be modified to reference the decorator to determine what aliases exist for a particular namespace.

@arizvisa
Copy link
Owner Author

Currently as per #158, the research into temporal modules has resulted in a solution for this using a proxy class (that maintains no internal state) which can change depending on a backing object. Thus combining that with descriptors will allow making proper aliases for different namespaces.

Also per #158, the pattern matching part for multicased functions is currently being redesigned which should allow for better performance when identifying the right function definition for a namespace attribute.

@arizvisa
Copy link
Owner Author

The multicased function feature has been redesigned algorithmically. Although I don't think that having real-aliased namespaces is too important, this should definitely be worked on as it shouldn't be too much extra work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant