[Baypiggies] Newbie-ish type questions...

Paul McNett p at ulmcnett.com
Wed Apr 23 18:29:40 CEST 2008

Kelly Yancey wrote:
> But, yes, it gets better in 3.0:
>     http://www.python.org/dev/peps/pep-3119/

Now *that* is reason alone to migrate to 3.0.

def myfunc(seq=None):
   if seq is None:
     seq = ()
   assert isinstance(seq, Sequence)

I assume that strings, bytes, lists, tuples, and sets would all have 
Sequence as an Abstract Base Class, while ints, floats, datetimes, and 
decimals would not.

It isn't that I always want to ask permission instead of forgiveness, 
but this will make for at least slightly simpler code, and seems to be a 
big move in the right direction.


More information about the Baypiggies mailing list