suggestions for improving code fragment please

The Night Tripper jkn+gg at nicorp.co.uk
Thu Feb 28 14:47:12 EST 2013


Hi there
    I'm being very dumb ... how can I simplify this fragment?


        if arglist:
            arglist.pop(0)
            if arglist:
                self.myparm1 = arglist.pop(0)
                if arglist:
                    self.myparm2 = arglist.pop(0)
                    if arglist:
                        self.myparm3 = arglist.pop(0)
                        if arglist:
                            self.parm4 = arglist.pop(0)
        # ...

    Thanks
    J^n





More information about the Python-list mailing list