Google Groupes n'accepte plus les nouveaux posts ni abonnements Usenet. Les contenus de l'historique resteront visibles.

How to signal "not implemented yet"?

14 vues
Accéder directement au premier message non lu

Roy Smith

non lue,
25 déc. 2005, 19:09:0125/12/2005
à
Is there some standard way to signal "not implemented yet" in
unfinished code? When I'm coding, I'll often only flesh out one side
of a branch, or delay writing some method until later. It would be
nice to be able to identify these right in the code to make sure they
don't get forgotten about.

I know I can just use "assert (False)", but that really means "this
can never happen", as opposed to "this can certainly happen, but I
havn't gotten around to dealing with it yet". An assert with a "not
implemented yet" comment would be better than the naked assert, but
the comment won't be exposed in automated testing.

How do other people do this?

Heiko Wundram

non lue,
25 déc. 2005, 19:19:5525/12/2005
à
Roy Smith wrote:
> How do other people do this?

raise NotImplementedError, "I chose not to implement this because of..."

(built-in exception)

--- Heiko.

Tim Peters

non lue,
25 déc. 2005, 19:18:2925/12/2005
à pytho...@python.org
[Roy Smith]

> Is there some standard way to signal "not implemented yet" in
> unfinished code?

raise NotImplementedError

That's a builtin exception.

...

Roy Smith

non lue,
25 déc. 2005, 19:41:4725/12/2005
à
In article <mailman.2539.1135556...@python.org>,

Ah, that's exactly what I was looking for. Thanks.

0 nouveau message