dummy/trash object
Emile van Sebille
emile at fenx.com
Mon Jul 9 06:46:22 EDT 2001
More information about the Python-list mailing list
Mon Jul 9 06:46:22 EDT 2001
- Previous message (by thread): Cool use for a generator?
- Next message (by thread): dummy/trash object
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
As I read the OPs question, it has to do with the unneeded assignment being performed. I took this in part as a performance issue, in which case simple use of _ performs much better, as on my system I can to 10M assigns a second. -- Emile van Sebille emile at fenx.com --------- "Marcin 'Qrczak' Kowalczyk" <qrczak at knm.org.pl> wrote in message news:slrn.pl.9kj26i.nof.qrczak at qrnik.zagroda... > 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
- Previous message (by thread): Cool use for a generator?
- Next message (by thread): dummy/trash object
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list