Consider removing array constants
See original GitHub issueI stumbled across this page, which lists four constants in the spec: e
, inf
, nan
and pi
.
I’m not strongly opposed, but it isn’t really clear to me why we need these in the spec when they already exist in Python’s builtin math
built. Given that these should be builtin Python float objects, it isn’t clear to me what we gain from including these, except saving users another import?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:10 (9 by maintainers)
Top Results From Across the Web
How to remove an element from an array in JavaScript
If you want to remove an element while leaving the original array intact (unmutated) then filter() is a good choice! Removing a single...
Read more >Delete Element in Array Constant - NI Community
Easier ways to manipulate Array controls and constants has been asked for a few times. My workaround suggestion would be to change the...
Read more >How to deleting const array in c++ [closed] - Stack Overflow
std::string::c_str returns a pointer to the internal char array of the string . It must not be deleted by the user because the...
Read more >Removing Items from an Array in JavaScript - Ultimate Courses
To remove an item from array via its index, we'll first introduce the Array.prototype.splice method and then investigate a better pattern using ...
Read more >Use array constants in array formulas - Microsoft Support
Use array constants in array formulas or by themselves to save time, ... An array constant nested in a SUM formula ... Delete...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I could live with leaving these out, but personally lean towards leaving them in for convenience. And because I don’t like the
math
module much, would rather not rely on anything in the stdlib.We discussed this in a call today. @kkraus14 had a strong preference for keeping these constants in, because he wants to be able to implement them as a custom Python object that’s a singleton (and duck-types as a
float
, e.g. by implementing__float__
). That way, once it’s on a GPU it can be reused there and this saves implicit syncs, compared to usingmath.pi
et al.Since no one is strongly opposed to keeping these constants in the API, that’s a good reason to stay with the status quo and keep them.