<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><span style="font-size: 11px;" class="">Hi,</span><br style="font-size: 11px;" class=""><br style="font-size: 11px;" class=""><span style="font-size: 11px;" class="">I'm working on building a number of related custom dtypes, and I'm not sure how to set the type and kind fields in PyArray_Descr.  I tried using type='V' and choosing a single unused kind for all my dtypes; this mostly worked, except I found that coercions would sometimes treat values of two different dtypes as if they were the same.  But not always... sometimes my registered cast functions would be called.</span><br style="font-size: 11px;" class=""><br style="font-size: 11px;" class=""><span style="font-size: 11px;" class="">Through trial and error, I've found that if I choose an unused type code for each dtype, coercion seems to work as I expect it to (no coercion unless I've provided a cast).  The kind doesn't seem to matter.</span><br style="font-size: 11px;" class=""><br style="font-size: 11px;" class=""><span style="font-size: 11px;" class="">I couldn't find any guidance in the docs for how to choose these values.  Apologies if I've overlooked something.  Could someone please advise me?</span><br style="font-size: 11px;" class=""><br style="font-size: 11px;" class=""><span style="font-size: 11px;" class="">More widely, is there some global registry of these codes?  Is the number of NumPy dtypes limited to the number of (UTF-8-encodable) chars?  It seems like common practice to use dtype.kind in user code.  If I use one or more for my custom dtypes, is there any mechanism to ensure they do not collide with others'?  Are there any other semantics for either field I should take into account?</span><br style="font-size: 11px;" class=""><br style="font-size: 11px;" class=""><span style="font-size: 11px;" class="">Thanks,</span><br style="font-size: 11px;" class=""><span style="font-size: 11px;" class="">Alex</span><div class=""><span style="font-size: 11px;" class=""><br class=""></span></div><div class=""><span style="font-size: 11px;" class=""><br class=""></span></div></body></html>