PMXBOT Log file Viewer

Help | Karma | Search:

#python2.8 logs for Thursday the 9th of January, 2014

(Back to #python2.8 overview) (Back to channel listing) (Animate logs)
[08:58:55] <jezdez> looking from the sidelines, can anyone summarize what has been discussed here?
[13:23:39] <wangofett> So...
[13:25:32] <wangofett> I've seen an (un)surprising number of posts about how a large roadblock to upgrades is that most lines of code in business have *no test coverage*
[13:25:37] <wangofett> or very little
[13:27:25] <wangofett> So I've been entertaining the thought - hey, what about something like https://github.com/ajalt/fuckitpy
[13:27:33] <wangofett> but instead of steamrolling errors
[13:27:59] <wangofett> it basically went through fuzz testing all of the functions/classes in one's code
[13:28:28] <wangofett> trying to identify just what sorts of criteria would make the thing work
[13:28:43] <wangofett> as well as break
[13:29:23] <wangofett> I don't know if reviewing the output for accuracy would end out just as much of a pain as writing the tests yourself
[13:29:34] <wangofett> but. It was a thought!
[13:56:58] <ztane> wangofett: i ported a 100ish .py package that was unknown to me in less than 2 hours, bc it had close to 100 % test cov.
[14:20:24] <wangofett> ztane: nice
[14:20:27] <wangofett> very nice
[14:24:40] <ztane> the print functions etc can be converted with 2to3, then add from __future__ import print_function
[14:24:52] <ztane> for polyglotting code...
[14:25:02] <ztane> hand checked all division operators...
[14:25:29] <ztane> then ran tests and there were surprisingly few bytes/str confusion
[14:30:19] <wangofett> That's pretty impressive. I've got the difference between bytes/str grokked, but actually remembering what takes/returns what is still something that isn't natural to me
[14:30:43] <wangofett> I keep having to just kind of guess whether it's decode or encode that I need :P
[14:32:02] <ztane> easier on py3, encode is that which you have on str, decode on bytes....
[14:32:12] <ztane> cant go wrong when runing with python3 :D
[14:33:49] <wangofett> It's my fave
[15:18:28] <Ivo> wangofett: it should be easy if you've grokked it. If you come across some sort of string, it should be either a unicode string or a byte string. If it's bytes and you want to deal with it as text, you want to *decode* it into unicode. If it's unicode that needs to be output/sent somewhere, you want to *encode* with an encoding into bytes to be transmitted
[15:20:20] <wangofett> Hm. Now to think of a mnemonic to help
[15:20:31] <wangofett> red and bytes... no...
[15:20:49] <wangofett> every byte decodes into unicode?
[15:21:02] <wangofett> every unicode encodes into bytes?
[15:21:12] <wangofett> EUEIB? lol
[15:25:21] <Ivo> wangofett: I think just make sure you understand one side. The other side will simply be the opposite. e.g if you always remember that "Bytes need to have their meaning decoded from them", then you can figure out in 2 seconds what the corollary process is (unicode needs to be *encoded*)
[23:56:38] <itamar> ztane: yes. did you know python 3 is terrible?
[23:56:51] <itamar> hm, guess that's way past your scroll history