I think this one is even simpler to illustrate the change:
class Foo: def __dir__(self): return ['a', 'b', 'c']
class Bar: def __dir__(self): return ('a', 'b', 'c')
print dir(Foo()) print dir(Bar())
AFAICT, in Python 2.7.1 you get two lines of ['a', 'b', 'c'] while in 2.7.2rc2, the second line gives you the TypeError.
I think this one is even simpler to illustrate the change:
class Foo:
def __dir__(self):
return ['a', 'b', 'c']
class Bar:
def __dir__(self):
return ('a', 'b', 'c')
print dir(Foo())
print dir(Bar())
AFAICT, in Python 2.7.1 you get two lines of ['a', 'b', 'c'] while in 2.7.2rc2, the second line gives you the TypeError.