dummy/trash object

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Mon Jul 9 06:34:58 EDT 2001


Mon, 9 Jul 2001 11:36:35 +0200 (CEST), Xavier Defrang <xavier at perceval.net> pisze:

> I'm sure that someone already came with a question like : "why is
> there no real dummy or trash object in Python which could by used
> like the magic '_' in Prolog?"

You can implement it yourself, but it will look a bit ugly:

class trash:
    def __setattr__(self, attr, val): pass
_ = trash()

x, _.y, z, _.u = t

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



More information about the Python-list mailing list