Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [imp-dev] API change in pdb.values Type

Given that the change would help to avoid errors that I could easily see new PDB users committing unknowingly, and particularly errors that can be hard to diagnose, I'd say the API change is warranted.

On Jul 7, 2010, at 9:31 AM, Jurgen Vinju wrote:
Hi!

I'm about to commit an API change, removing an argument from the
method Type.instantiate(TypeStore store, Type type) in pdb.values.

The store argument was a design flaw. A TypeStore should hold only
declarations of (type parametrized) abstract data types, not
instances, so instantiating a type with actual type parameters should
not need a TypeStore from anywhere.
Removing the argument obviously makes sure nobody accidentally passes
in a TypeStore.
TypeStores that accidentally hold type instances instead of type
definitions eventually lead to subtle bugs, that's what I'm trying to
prevent here.

I'm not sure this is clear for anybody that has not read or used the
pdb.values code, but I wanted to put out this alert anyway. If you
have this method in use, simply removing the parameter will fix your
code.

Cheers,

Jurgen

Cheers,
 - Bob



Back to the top