diff --git a/drivers/python/rethinkdb/__init__.py b/drivers/python/rethinkdb/__init__.py
index <HASH>..<HASH> 100644
--- a/drivers/python/rethinkdb/__init__.py
+++ b/drivers/python/rethinkdb/__init__.py
@@ -1,17 +1,15 @@
 # Copyright 2010-2014 RethinkDB, all rights reserved.
 
+# Define this before importing so nothing can overwrite 'object'
+class r(object):
+    pass
+
 from .net import *
 from .query import *
 from .errors import *
 from .ast import *
 from . import docs
 
-
-# The __builtins__ here defends against re-importing something
-# obscuring `object`.
-class r(__builtins__['object']):
-    pass
-
 for module in (net, query, ast, errors):
     for functionName in module.__all__:
         setattr(r, functionName, staticmethod(getattr(module, functionName)))
fixing compatibility for pypy - modules cannot be used as a dict