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

Empty Tuple Method #167

Open
ParadaCarleton opened this issue Dec 4, 2021 · 2 comments
Open

Empty Tuple Method #167

ParadaCarleton opened this issue Dec 4, 2021 · 2 comments

Comments

@ParadaCarleton
Copy link

When Zeros or Ones gets an empty tuple as its only argument, perhaps we should return zero or one? This way functions that can be called on both arrays and numbers can be simplified, instead of having to special-case numbers.

@dlfivefifty
Copy link
Member

I don’t understand. Shouldn’t it be a 0-dimensional Zeros / Ones?

One should never return a different type from a type constructor

@ParadaCarleton
Copy link
Author

ParadaCarleton commented Dec 4, 2021

That's true. Maybe we could add a lazy_zero method with this behavior? (i.e. return Zeros for array arguments and 0 for number-like arguments.)

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

2 participants