Re: [patch] [python] PR python/15461 (gate architecture calls)

Paul_Koning
2013-08-28T18:14:22Z

On Aug 28, 2013, at 1:54 PM, Tom Tromey <tromey@redhat.com> wrote:

> Phil> Something I thought about is not allowing gdb.Architecture to be
> Phil> instantiated directly, but I could not think of a clean way to do
> Phil> this.
>
> Did you think of any way?
> It seems like a good thing to prevent.

Ditto for all the existing types for which direct instantiation doesn't do anything useful.

I haven't tried this, but judging from the Python docs, if you point the tp_new field of the type object to a function that sets a suitable Python exception, that should do the job.

paul