4. It implements ISO 8601 (which exists for a reason):
https://en.wikipedia.org/wiki/ISO_8601#Calendar_dates
On 7/14/2022 6:25 PM, MRAB wrote:
I much prefer -MM-DD (or .MM.DD) because:
1. It's consistent with HH:MM:SS and other instances where there are multiple
units (they go from
On 1/8/2021 2:50 PM, Chris Barker via Python-Dev wrote:
If there are other common types this helps with, sure. But for numpy, as pointed out elsewhere in this thread, it would still fail for numpy arrays of > 1
dimension.
Personally I think this is really an issue with the structure of unitest
This comment completely misses the point.
This "weird type" qualifies as a Sequence.
(See collections.abc.)
Alan Isaac
On 12/22/2020 3:09 PM, Ivan Pozdeev via Python-Dev wrote:
Or just bail out ("resist the temptation to guess") and tell the user to
compare their weird types themselves.
]==np.array([False, False]): print("foo") <...>
ValueError: The truth value of an array with more than one element is ambiguous.
Use a.any() or a.all()
On 22.12.2020 21:52, Alan G. Isaac wrote:
The following test fails because because `seq1 == seq2` returns a (boolean)
NumP
The following test fails because because `seq1 == seq2` returns a (boolean)
NumPy array
whenever either seq is a NumPy array.
import unittest
import numpy as np
unittest.TestCase().assertSequenceEqual([1.,2.,3.], np.array([1.,2.,3.]))
I expected `unittest` to rely only on features
On 11/24/2020 4:40 PM, Marco Sulla wrote:
I have a question about pattern matching: is it used often
in math language as Mathematica?
Yes, pattern matching is absolutely fundamental to Mathematica.
See the `MatchQ` function:
https://reference.wolfram.com/language/ref/MatchQ.html
This works
In Mathematica, you might do this as (roughly):
rules = {
{x_, y_, z_} :> {x, y, z},
{x_, y_} :> {x, y, 0.0},
x_ :> {x, 0.0, 0.0}
}
process[Replace[obj, rules]]
Whatever you think of the particular syntax:
The ability to declare resuable rules seems good.
Thinking of replacement
Which people in the Python community are entitled to say that
they find a commit message to be offensive and have that claim
treated seriously, compassionately, and as a good reason for
accommodative action? Under what circumstances is the
appropriate response of the community a dismissive
"you