I had a bug where nan floats failed to compare equal because there seems
to be more than one nan value and comparison seems to be binary based.
How about we make float eq test if both are math. Isnan?
-- Arkadiusz Bulski --
___
Python-ideas mailing lis
I am using declarative testing a lot and I found out why unit tests are so
clunky. The reason why assertEquals(a,b) is used is because if we put
`assert a==b` then nose can catch the AssertionError but wont find out what
was returned or expected. This could be easily overcome if we allow
oveloading
Sometimes I find myself in need of this nice operator that I used back in
the days when I was programming in .NET, essentially an expression
>>> expr ?? instead
should return expr when it `is not None` and `instead` otherwise.
A piece of code that I just wrote, you can see a use case:
def _
Hey, I just did put my thoughts on the discussion floor. Dont yell at me
for it not being the most interesting idea ever. There were few interesting
responses after all. Lets move on.
pozdrawiam,
Arkadiusz Bulski
___
Python-ideas mailing list
Python-id
> You've probably spent way more time debating shuffled here than you would
have needed to add a shuffled function to your test file.
Another presupposition. I did add it to my utility. I am proposing to add
this to the std library so that others dont have to.
pozdrawiam,
Arkadiusz Bulski
___
> So, why can't you call random.shuffle(all_tests) if you want to run your tests
in random order?
I dont randomize test order. People should stop assuming that they know
better. I need to randomize some arguments for one particular test and I
cannot call shuffle between tests. Its a continous list
If you want to see the declarative tests, here it is.
https://github.com/construct/construct/blob/master/tests/test_all.py
pozdrawiam,
Arkadiusz Bulski
2016-09-08 2:13 GMT+02:00 Arek Bulski :
> See for yourself. There is a long list of declarative tests.
> https://github.com/con
Thank you all for the meta discussion. I know we sidetracked a bit but
please everyone remember, this is an open discussion floor.
I can present you a use case, just didnt think I even needed one. This
seems so obvious to me that it should just go in without much saying. In
the project I maintain
> And if random.shuffle() returned a new list, other people would be bitten
because they expected it to be in-place.
No one proposes that. shuffled() should be a new function.
> One moderately stong piece of evidence would be if this function is widely
available in third-party libraries and other
They closed it. Will they accept a patch if I send it?
Where is the repo for the code? Never submitted anything to py code base.
-- Arkadiusz Bulski --
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python
shuffled() should be in the random module, of course. I dont suggest a
builtin. Although now that you mentioned it, I could go for that too.
There are usage cases where its heavily used, in randomized testing for
example. I am sure that there are also other domains where randomization of
lists is
We should add shuffled() analog to sorted. Also shuffle() should return
self so mutating methods could be chained.
-- Arkadiusz Bulski --
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of
I have a piece of code that essentially reimplements OrderedDict. I have
been wondering why the key ordered is not preserved correctly (tests fail).
c = Container(a=1,b=2,c=3,d=4)
self.assertEqual(c.keys(), ["a","b","c","d"])
self.assertEqual(c.values(), [1,2,3,4])
self.assertEqual(c.items(), [("a
.
pozdrawiam,
Arkadiusz Bulski
2016-08-27 11:04 GMT+02:00 Arek Bulski :
> SI units are a standard that was kind of imposed top down on the computer
> science community. But we learned to use KB MB so why no keep the defacto
> standard we already have? Kibibytes and mibibytes were nev
SI units are a standard that was kind of imposed top down on the computer
science community. But we learned to use KB MB so why no keep the defacto
standard we already have? Kibibytes and mibibytes were never really
adopted.
1K == 1000
1KB == 1024
1M == 1000**2
1MB == 1024**2
Suffixes, simple.
i
Could use all(a==b for zip(seq,seq2))
-- Arkadiusz Bulski --
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/
One person saying "this thread doesnt belong here" doesnt make it so. I
have met too often in my life with a situation where people were chasing
others away because they simply didnt like the particular topic. This
thread still Has its participants. You are replying on it As well. And
until Discuss
For those talking abstract points, here is a screenshot of GitHub. Works
like a charm on mobile.
https://s3.postimg.org/e30lc3tk3/Screenshot_2016_08_15_13_00_59_com_browser_inter.png
15 sie 2016 10:34 AM "Arek Bulski" napisał(a):
> But we do not care if the experimental animal dies
But we do not care if the experimental animal dies, that is the point of
doing the experiment.
I registered at Discuss and kina like it. Then tried to create a new thread
and my Android keyboard shows over the fields. Discuss As it is now doesnt
work for mobile.
14 sie 2016 9:35 PM "Arek B
, keep it. Dont make the rest of us put up with this
shit.
There is no definition of fails just As i dont have a definition of
consensus. People will stick to it or not. No voting, just participation.
14 sie 2016 1:57 PM "Arek Bulski" napisał(a):
I throw a proposal on the table: let
I throw a proposal on the table: lets create a "python-ideas" repo under
"python" account on GitHub and move this and only this thread onto it. If
it fails, nothing but this thread is lost (not persisted in the mailing
list) which would make no difference anyway. People made many points that
are p
Praise the guide! (Guido)
GitHub issues are also delivered by email, with full post content. Guido
and others will be satisfied. And mailing lists also send you messages in
whatever freakin interface they provide it. And on my android gmail app it
aint pretty. Most of it is auto replies in plain
I have been a subscriber only for few weeks now but I dont like the mailing
list at all. First, I get all the topics even tho Windows encoding is not
of my interest. Second, most of the text is auto quotes anyway. Third,
editing posts can sometimes be helpful, for correcting typos and such.
I thin
23 matches
Mail list logo