Skip to content

Instantly share code, notes, and snippets.

@olemb
Created August 25, 2011 18:36
Show Gist options
  • Select an option

  • Save olemb/1171411 to your computer and use it in GitHub Desktop.

Select an option

Save olemb/1171411 to your computer and use it in GitHub Desktop.
types.py
Today's lesson: Never call your module types.py if you plan to run
Python from when standing in the same directory. It took me some
time to figure out what was going on:
$ touch types.py # empty file
$ python
Traceback (most recent call last):
File "/usr/lib/python2.7/site.py", line 68, in <module>
import os
File "/usr/lib/python2.7/os.py", line 398, in <module>
import UserDict
File "/usr/lib/python2.7/UserDict.py", line 83, in <module>
import _abcoll
File "/usr/lib/python2.7/_abcoll.py", line 70, in <module>
Iterable.register(str)
File "/usr/lib/python2.7/abc.py", line 107, in register
if not isinstance(subclass, (type, types.ClassType)):
AttributeError: 'module' object has no attribute 'ClassType'
"Weeeaaht?"
@mid-kid
Copy link
Copy Markdown

mid-kid commented Jul 26, 2013

Oh shitlord. This was really helpful.

@kevinseelbach
Copy link
Copy Markdown

I should buy you a beer , can't believe I did this

@pyKun
Copy link
Copy Markdown

pyKun commented Sep 7, 2015

your python crashed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment