Google グループは Usenet の新規の投稿と購読のサポートを終了しました。過去のコンテンツは引き続き閲覧できます。
Dismiss

How to signal "not implemented yet"?

閲覧: 14 回
最初の未読メッセージにスキップ

Roy Smith

未読、
2005/12/25 19:09:012005/12/25
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

未読、
2005/12/25 19:19:552005/12/25
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

未読、
2005/12/25 19:18:292005/12/25
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

未読、
2005/12/25 19:41:472005/12/25
To:
In article <mailman.2539.1135556...@python.org>,

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

新着メール 0 件