Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to signal "not implemented yet"?

14 views
Skip to first unread message

Roy Smith

unread,
Dec 25, 2005, 7:09:01 PM12/25/05
to
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

unread,
Dec 25, 2005, 7:19:55 PM12/25/05
to
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

unread,
Dec 25, 2005, 7:18:29 PM12/25/05
to 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

unread,
Dec 25, 2005, 7:41:47 PM12/25/05
to
In article <mailman.2539.1135556...@python.org>,

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

0 new messages