Andrew Nelson a écrit :
> I think I need a little clarification here. The reason I put the
> try/except in is because |np.array(bounds, float)| will raise a
> ValueError if |bounds| has non numerical values. With the try/except
> block I can catch that and tell the user where they went wrong by giving
> a better error message.  If I make your suggestion they won't get that
 > message.

AFAICT, you don't tell the user anything specific to the "kind" of 
ValueError raised as the message is always the same.

>  Which is the preferred scipy/python way of doing this?

Like I said already,

```
if not [check something]:
     raise ValueError([some useful message])
```

You can grep ValueError in scipy (or just scipy/optimize) for examples.