PEP 317: Eliminate Implicit Exception Instantiation

Gerrit Holl gerrit at
Tue Jun 10 11:32:05 CEST 2003

Steven Taschuk wrote:
>        raise MyError()

Just curious: am I the only one who always does this and is
accustomed to this style?

11:30:26:4:gerrit at stopcontact:~/cvs/brian$ grep "raise " *.py    def next(self): raise StopIteration()            raise errors.UndefinedAttributeError(self.__class__, *missing)                raise errors.SingleCollision(self, sprite)            raise errors.OutsideArea(w, self.rect)            raise errors.DataError("image", self)        raise errors.UndefinedMethodError(self.__class__, 'getbullet')            raise errors.UnableShooting(self)            raise errors.ShootingReload(self, cf=self.frame, \            raise errors.UnexspectedCollision(self, item, "I'm in a wall")            raise TypeError("Bullet constructor takes 2-3 args")        raise SystemExit()                raise errors.EndGame()                raise NotImplementedError("please wait ;)")                raise errors.EndGame()            raise AttributeError(msg)            raise UsageError("at least one attribute must be given")                    raise errors.GivenUpSpritePlacement(spr, counter)                raise errors.SpriteTooLarge(, (w, h))                raise errors.GivenUpSpritePlacement(wall, counter)            raise NotImplementedError("only tiled mode supported, mode is", self.bgmode)            raise errors.UsageError("mode must be one of %s" % self.modes)    ordering, and if list(s).sort() doesn't raise TypeError it's        raise Exception()


50. If he give a cultivated corn-field or a cultivated sesame-field,
the corn or sesame in the field shall belong to the owner of the field,
and he shall return the money to the merchant as rent.
        -- 1780 BC, Hammurabi, Code of Law
Asperger Syndroom - een persoonlijke benadering:
Het zijn tijden om je zelf met politiek te bemoeien:

More information about the Python-list mailing list