PEP 317: Eliminate Implicit Exception Instantiation

Gerrit Holl gerrit at nl.linux.org
Tue Jun 10 05:32:05 EDT 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
basesprites.py:    def next(self): raise StopIteration()
basesprites.py:            raise errors.UndefinedAttributeError(self.__class__, *missing)
basesprites.py:                raise errors.SingleCollision(self, sprite)
basesprites.py:            raise errors.OutsideArea(w, self.rect)
basesprites.py:            raise errors.DataError("image", self)
basesprites.py:        raise errors.UndefinedMethodError(self.__class__, 'getbullet')
basesprites.py:            raise errors.UnableShooting(self)
basesprites.py:            raise errors.ShootingReload(self, cf=self.frame, \
basesprites.py:            raise errors.UnexspectedCollision(self, item, "I'm in a wall")
basesprites.py:            raise TypeError("Bullet constructor takes 2-3 args")
brian.py:##        raise SystemExit()
brian.py:                raise errors.EndGame()
brian.py:                raise NotImplementedError("please wait ;)")
brian.py:                raise errors.EndGame()
DataServer.py:            raise AttributeError(msg)
errors.py:            raise UsageError("at least one attribute must be given")
level.py:                    raise errors.GivenUpSpritePlacement(spr, counter)
level.py:                raise errors.SpriteTooLarge(self.world.size, (w, h))
level.py:                raise errors.GivenUpSpritePlacement(wall, counter)
screen.py:            raise NotImplementedError("only tiled mode supported, mode is", self.bgmode)
screen.py:            raise errors.UsageError("mode must be one of %s" % self.modes)
util.py:    ordering, and if list(s).sort() doesn't raise TypeError it's
util.py:        raise Exception()

yours,
Gerrit.

-- 
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:
	http://people.nl.linux.org/~gerrit/
Het zijn tijden om je zelf met politiek te bemoeien:
	http://www.sp.nl/





More information about the Python-list mailing list