-
Notifications
You must be signed in to change notification settings - Fork 270
tlz package: cytoolz or toolz
#314
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
Conversation
…lable or `toolz`. Currently, in order to do `import tlz`, `toolz` needs to have already been loaded.
|
Would it be possible to do this without import tricks by having a second top-level package named |
|
For some non-performance-critical functions like |
|
Yeah, I expect it's possible to have a second top-level package Since we manually construct new modules for |
|
I think that you create a new top level package directory |
Oh, you don't want any import tricks? Would you rather create files for every module? i.e., something like this: try:
import cytoolz.curried as mod
except ImportError:
import toolz.curried as mod
orig_globals = dict(globals())
globals().update(mod.__dict__)
# TODO: handle submodules such as `toolz.curried.operator`
globals().update(orig_globals)
del mod
del orig_globalsI don't think we should be shy about using |
|
OK. Great |
|
btw, my first attempt did use a separate My plan is to make a separate |
|
This seems like a reasonable idea. It has come up a few times. I think that someone, maybe @jiffyclub maybe implemented this somewhere? The negative side of this is that it's a hard decision to reverse. That shouldn't really stop us though. No strong opinions on the name. tlz sounds fine. Is suspect that others will swing by with naming suggestions. |
|
My solution for this is here: https://github.com/jiffyclub/zbox |
…toolz`. Hence, if you do `tlz.functoolz??` in IPython, you'll see `toolz.functoolz`.
Test Python 2.6 again, but exclude `tlz`.
|
|
|
Sounds good to me. Other pipe-like things might be nice as well ( |
|
No strong thoughts from me. On Oct 6, 2016 19:03, "Jim Crist" notifications@github.com wrote:
|
|
|
Create a package
tlzwhose modules are populated bycytoolzif available ortoolz. This is to provide a convenient way to import the faster oftoolzorcytoolz. For example:This is largely experimental. Something that provides this functionality has been on the radar for a while.
By having
tlzbe a part oftoolz, it will always be available iftoolzorcytoolzis installed (i.e., one doesn't need topip install tlz). A disadvantage of the current approach is that a user needs to importtoolzbefore importingtlz. Is there a good way to makeimport tlzwork without first importingtoolz?Python 2.6 dropped, because it doesn't have
importlib, and developing a compatible way to do this would be annoying. Dealing with the import system across Python 2.7 and Python 3.3+ is already annoying enough.