python __debug__

The other day I stumbled upon Python __debug__ and I thought I would share some interesting things I learned about it.

What is python __debug__?

It is a constant that Python uses to determine if calls to assert should result in code being generated. If you have the -O optimization flag ¬†set, then assert calls will not be “triggered” in your code, even if the condition it is testing is true.

Interesting fact: according to the documentation it is one of two constants that will raise a SyntaxError exception if you attempt to assign something to it. (The other constant that does this is None.)

For example, in python you can do this:

How to assign false to true in python

Totally legal. Not smart, but legal.

And that is totally legal in Python 2.x. (Python 3 wisely does not allow this!) I would not recommend doing this, as your co-workers will hunt you down to express their “displeasure”. But if you try that with __debug__ or None, you’ll get an error:

can't assign things to __debug__ or None

The only two “true” constants in python

Normally I’m not a fan of these types of language tricks, but this looked pretty cool to me and I thought I would share. I do find it interesting that in Python 3 they have True and False locked down to be true constants. Honestly, I thought there would be more language keywords that would be protected like that.


Tips for using Slack with your Mastermind group

Also known as the “Software Engineering Ass-kicking aLliance”

Recently I joined a mastermind group. We meet weekly via Google Hangouts to talk and discuss our week. While is great, sometimes you need to talk before the scheduled meeting. We’ve got 2 options open to us, an email list and a private slack channel. I have found that the slack channel has been very valuable and makes this mastermind much more powerful. Let’s talk about some slack mastermind tips to make you as successful as you can be! Continue reading

Improving your python: using pylint and flake8 in emacs

python using pylint flake8 in emacsIn a previous post I mentioned an issue I had with some python code that failed in a way I hadn’t expected.

Long story short, I was in the wrong which does happen from time to time. Aside from the actual bug, there was another failure: I thought my tools were checking my work. It turned out this was not the case!

I’ve been a big fan of flake8 for some time. Its ability to find PEP8 issues is a big help, and most of the time I find that it tends to root out problem code before it gets too bad. When I was dealing with that bug I was using PyCharm. I’ve since started using emacs, but would that have made a difference?

It turns out if I had been using pylint I might have caught this issue. I’m placing the emphasis on might there because there’s a bit of overlap between flake8 and pylint that I wasn’t aware of. Let’s explore them a little bit more. Continue reading

Things I’m thankful for

This past weekend was Thanksgiving here in the US. This is a time of year where we try to reflect on the things we are grateful for. Well, at least that’s what we are supposed to do. Some folks tend to use it as an excuse for excess…

But I digress. I’ve been on quite the adventure the last year so I thought this would be a good time to take stock and see where I’ve been. So given that here’s some things I’m grateful for.


This is a great time to be alive. There are so many things available to most people (especially here in the U.S.) and all that you have to do is reach out and take them. I’ve always known this, but have I always taken advantage of it? Perhaps not.

This year I worked harder to take advantage of things that came my way. Truthfully its pretty amazing what things are around you most of the time. Opportunities to learn, opportunities to earn, opportunities to just be involved. Going forward I’m resolved to say yes to more things.


There’s an old saying that “no man is an island”. Being involved in communities is a wonderful thing. Finding your tribe is one of the greatest things you can accomplish. Be it a programming community (Python is great!) a neighborhood group, or a mastermind (I’ll have a lot more to say about that in the near future!), finding a group can make a world of difference to your outlook.

I’ve found a few communities this year and I feel it has helped me grow in a lot of different way. I’m very grateful for finally realizing that having a group (or several) is a great thing to have.


Family is where its at. Big or small, blood or not, having a support system you can always count on is so important.

Find or make one. You need it. I’m grateful for mine.


This year I began to explore the true meaning of consistency. Publishing this blog every week has been part of that consistency. Thank you for reading and helping me keep this consistent habit. ūüôā

I’ve also been working to consistently reflect on things at the end of the week, or more frequently in some cases. This simple practice is very powerful, it is “forcing” me to be aware of things. Part of this reflection is thinking about things I’m grateful for.


This has been a pretty hectic year, but one that I’m very thankful for. What are you thankful for?

Becoming a better programmer

Becoming a better programmer one step at a time

Navy SEALs jump from the ramp of a C-17 Globemaster III over Fort Picket Maneuver Training Center, Va. (Air Force photo by Staff Sgt. Brian Ferguson)

In the Navy SEALs they have a saying: Everyday you have to earn your trident. The trident is the symbol that sailors earn as they complete the training that makes them part of the elite SEALs. It is possible to lose one’s trident however. To prevent a behavior that might cause this, the SEALs remind themselves that everyday they have to “earn (the right to wear) their trident”.

As I spend more time in the programming world I have come to realize there is great wisdom in this approach. A good friend of mine once told me that “Experience and skills are expiring assets.” In other words, if you don’t use them, you loose them. Just because your job title has the word “Senior” in it, you don’t automatically get a pass. You need to earn that title every day.

So as a programmer, how can you earn your place? How can you improve who you were yesterday? What does it take to make sure you are becoming a better programmer? Here’s what I’ve been doing. Continue reading

My experiences with 5 different Continuous Integration servers

I’ve become the Johnny Appleseed of Continuous Integration servers.

After I was bit by the testing bug, I quickly¬†developed an interest in CI and began setting up servers at the places I worked. The benefits of letting a computer run the test automatically are so appealing. It cuts down the number of “dumb” bugs that are¬†generated. It also helps ensure that the code is still working the way it used to.

What is a “dumb” bug? It is one of those bugs that is very simple (like a missing parens) and is found as soon as another person takes a look at your code. The discovery usually leads to a facepalm by the developer who did it.

Over the years as I’ve traveled to different companies I’ve been able to help introduce various Continuous Integration servers to other developers. If you would like to learn more about why CI is important, I will to point you to THE resource that I learned from, Continuous Delivery by Jez Humble. Its a big read, but it really covers the topic well and offers a lot of useful strategies.

Here’s a run down of my experiences with 4 different Continuous Integration servers. Continue reading

On moving from Java into Python

Before coming to Python, I did a lot of work in Java. Java is pretty good language and From Java into Pythonenvironment, but it is different than Python. Beyond the language syntax there’s a ton little differences to be aware of. Sometimes when we move from Java into Python it shows by some of the things that we do.

Here’s some things I’ve learned over the years, (or things that I’ve stubbed my toes on recently). Continue reading