Note, PythonTidy[1] skips this check, and does not give a better solution. :(

@@ -1139,63 +1289,67 @@
         """
         Closure that returns an iterator over handles in the database.
         """
+
         def g(self):
             with curs_(self) as cursor:
-                for key, data in cursor:
+               for (key, data) in cursor:
                     yield handle2internal(key)
+
         return g
 
     def _f(curs_, obj_):
         """
         Closure that returns an iterator over objects in the database.
         """
+
         def g(self):
             with curs_(self) as cursor:
-                for key, data in cursor:
+               for (key, data) in cursor:
                     obj = obj_()
                     obj.unserialize(data)
                     yield obj
+
         return g
 
The only one 'real' change is maybe for b'' mark on some part of the code.

@@ -1444,29 +1637,34 @@
         Return the Researcher instance, providing information about the owner 
         of the database.
         """
+
         return self.owner
 
     def get_default_person(self):
         """Return the default Person of the database."""
+
         person = self.get_person_from_handle(self.get_default_handle())
         if person:
             return person
-        elif (self.metadata is not None) and (not self.readonly):
-            self.metadata[b'default'] = None
+       elif self.metadata is not None and not self.readonly:
+           self.metadata['default'] = None
         return None
 
     def get_default_handle(self):
         """Return the default Person of the database."""
+
         if self.metadata is not None:
-            return self.metadata.get(b'default')
+           return self.metadata.get('default')


It seems that "the annotation write(b: bytes) was too restrictive (anything supporting the buffer protocol would be allowed)." according to PEP0008

 http://legacy.python.org/dev/peps/pep-0008/


[1] https://pypi.python.org/pypi/PythonTidy/


Le sam. 10 mai 2014 at 8:39, Vassilii Khachaturov <vassilii@tarunz.org> a écrit :
Things are evaluated in order of appearance. So if you have a

def foo(bar):
  ...
def foo(bar, baz):
  ...

then anything after the block will see the 2nd definition only, overriding the 1st and obliterating it forever. (Unless something aliases the 1st foo in betwen, e.g.
def foo(bar):
  ...
preserved_foo = foo
def foo(bar, baz):
  ...