2014.12.29 – Rookie Mistakes

Back to work for me! I’m so thankful and also bummed that this job thing will be ending soon. It’s been nice to have an office to go to each day, to be accepted as part of the team, to learn a ton in a short amount of time, and to have a paycheck!

It’s another short week this week so I’ve been trying to make up for it by working longer days. I don’t mind though because it’s a comfortable place to be. Mele was out sick so we wouldn’t be having our 1-on-1 today. I jumped back in to trying to figure out this stupid Python thing but I was not getting anywhere. I finally caved and messaged Adam. I told him I was frustrated and he said my frustration earned me a hint. Excellent! But when I got his hint it was something I had already tried. Huh. Doh! I had fixed the issue but didn’t know it because before the change I had six failing tests but afterward I had twenty-three failing tests. That just couldn’t be good right? Well it was great because it fixed the main issue hiding the twenty-three (ok not really that many since one change can fix several tests) others. Ugh, I felt as though I had wasted a ton of time.

I was back on track though and was able to work through the other issues until I only had ten failing tests. The error I was getting was:

TypeError: Can't convert 'bytes' object to str implicitly

Soooooo I spent the next several hours trying to figure out why this was happening and what I needed to change. I learned a tiny bit about Unicode, bytes, bytestrings, strings, characters, utf-* encoding and decoding but nothing that lead me to a particular solution for this problem. I changed code many, many times but nothing really helped. Bleh!

After a decent amount of time screwing with it Adam happened to walk into the hangar. I gave him the “I need help” look, whatever that is. Apparently he knew because he came over and sat down with me. Of course he was pretty quickly able to see that I was trying to fix the code in the API but what I needed to be fixing was the data the test was passing to it! Wow, two strikes for me. He explained how Python 3 handled strings and bytes and I tried my hardest to understand but I’m still on shaky ground there for sure.

Anyway, he showed me what I needed to change in my test. I was passing in a string but had to explicitly state that it was a string containing bytes by prefixing it with a ‘b’. Yeah, I read that a bajillion times in my research but what the hell does that mean?? Something about a ‘b’ and a ‘u’ but don’t use the ‘u’ but wait you can use the ‘u’ again. I still don’t completely know wtf is going on. Whatever, it fixed three tests.

I was down to seven failing but couldn’t get it figured out by the time I was getting picked up and I was NOT going to ask Adam for help three times in one day! On a positive note I was able to help Amanda a bit with her code so that was good. All in all it was a good day filled with learning, frustration, and tea but mostly frustration 🙂

Wayne was making burritos for dinner. Yum! His beans are the best. After dinner Andrew sat down with me and tried his best to explain Unicode, strings, byte literals, encoding, decoding and I don’t even know what else but it made enough sense that I was able to fix my remaining tests and they all pass in both versions of Python! Time for something mindless…..

Today I learned that Unicode is hard. This guy isn’t thrilled with Python 3 and Unicode.