On Mon, Mar 18, 2013 at 3:13 AM, Stefan Krah <ste...@bytereef.org> wrote:
> Larry Hastings <la...@hastings.org> wrote:
>>     So I hope that at least converters can be declared statically in a header
>>     file, like I suggested in PEP 437.
>>
>>
>> The Argument Clinic prototype is written in Python; I don't know how 
>> "declared
>> static in a header file" applies to a Python implementation.  Currently the
>> converters are declared directly in clinic.py, somewhere in the middle.
>
> It applies in the same way to a Python implementation as declaring the
> DSL comment blocks in a C file applies to a Python implementation. This
> is exactly the same.
>
> 1) I think that third party tools should be able to extract *all* required
>    information from the DSL only.
>
> 2) After writing a new custom converter, I'd rather edit a header file and
>    not the preprocessor source.
>
> 3) Likewise, I'd rather edit a header file than inserting a magic [python]
>    block into the C source that registers the required information with
>    the preprocessor in a completely implementation defined way.

We didn't spend much time on this (we were focused on the per-function
DSL), but I agree a DSL for converters would be highly desirable, and
quite like the one in PEP 437.

It would require some tweaks to correctly handle the converter
parameterisation (for example, in the "es#" case, "encoding" is an
input to the converter rather than an output. This is why PEP 436 now
allows a callable notation for type converter references)

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to