<br><br><div><span class="gmail_quote">On 11/29/06, <b class="gmail_sendername">Talin</b> <<a href="mailto:firstname.lastname@example.org">email@example.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Guido van Rossum wrote:<br>> Have you thought much about the issue of different signature? The<br>> regular method table only has functions taking one or more objects and<br>> returning an object. (There are a few flags to indicate variations on
<br>> the call args.) The special slots have all sorts of other signatures,<br>> some returning int, some returning void, some taking ints or C<br>> strings, etc. (And changing this would be a huge inefficiency in some
<br>> cases.)<br>><br>> Not using some variant of C (or C99) struct initialization means more<br>> chance for undetected errors since you will necessarily have to cast<br>> everything to a standard type and then the compiler can't type-check
<br>> that the function signature matches the slot's needs.<br><br>Yes, there will be some loss of type safety. I'm not sure what to say<br>about that. (Although, there is one benefit that you will at least be<br>able to declare the "self" argument as its concrete type, rather than as
<br>PyObject *.)</blockquote><div><br>I must be missing something, why is this any different than what you can do now? You either define the function with the exact call signature as typed for the struct field, or you define how you want the arguments to be treated and you cast to the call signature that is expected for the struct field.