-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
__init__.nyan support #59
Comments
I'd be interested in working on this. When trying to import It should be pretty simple to generate those strings and check if the corresponding files exist using something like the |
Python prefers the package over the single file, but throwing an error would be better i think when both are present. In there the |
Yeah, this is a little more complex than I first thought. Let me see if I've got this right. Like you said Inside the
Then all imports are read from that file and added to the
So I'm starting to think that every constructor would need to be updated to check for init files and that there should be a flag to indicate that this namespace is connected with an init file. If the flag is not set, The simplest thing to do would be to only allow top-level init files because that would mean only changing the |
Add support for
__init__.nyan
files that behave like Python's__init__.py
. When a folder is imported, this file is loaded and its definitions are loaded.The definitons are handled just like a regular
nyan
file.Definitions in
/rofl.nyan
are loaded exactly the same way as the same definitions in/rofl/__init__.py
.Nyan will abort loading if both a
/name.nyan
and/name/...
folder are a candidate for loading.The
__init__.nyan
is designed for imports (and alias definitions), that redirect to declarations of other nyan files in the same (or a sub-)folder.The text was updated successfully, but these errors were encountered: