资料下载网
首页 计算机 考试教辅
Argument Clinic How-To pdf电子书免费下载,百度云
首页 > 计算机 > 计算机F > Argument Clinic How-To pdf电子书免费下载,百度云

《Argument Clinic How-To》pdf电子书免费下载


下载方式一:

百度网盘下载地址:https://pan.baidu.com/s/19kS_aNMKfIUBmw9_YZnEuQ
百度网盘密码:1111

下载方式二:

http://ziliaoshare.cn/Download/af_123562_pd_ArgumentClinicHow-To.zip

 


Argument Clinic How-To

作者:empty

出版社:empty

《Argument Clinic How-To》介绍

Argument Clinic is a preprocessor for CPython C files.I is purpose is to automate all the boilerplate involved withwriting argument parsing code forT buil s , This document shows you howto convert your first C function towork wth Argument Cl nic, and then introduces some advanced topics on Argument Clinic usageCurrently Argument Clinic is considered internal-only for CPython.Is use is not supported for files out ideCPython, and no guarantees are made regarding backwards compatibility for future versions, In other wordsif you maintain an external C extension for CPython, you're welcome to experiment with Argument Clinic inyour own code.But the version of Argument Clinic that ships with the next version of CPython co uid be totallyin compa ible and break all youre ode.1 The Goals Of Argument ClinicArgument Clinic's primary goal is to takeover responsibility for all argument parsing code inside CPython.Thismeans that.when you convert a function to work with Argument Clinic, that function should no longer do any of itsown argument parsing the code generated by Argument Clinic should be a blackbox to you, where CPython callsin at the top, and your code gets called at the bot fom, with PyObject*args f and maybe PyObject*kwargs)magically converted into the C van ables and types you need.In order for Argument Clinic to accomplish its primary goal, it must be easy to use.Currently, working with CPython'sar gum nent parsing library is a chore, requiring maintaining redundant information in a surprising number of places.When you use Argument Clinic.you don't have to repeat yourself.Obviously, no one would want to use Argument Cnic unless is solving their problem—and without creat ng newproblems of its own.So ifs paramount that Argument Clinic generate correct code.Ird be nice if the code wasfaster, too, but at the very least it should not introduce a major speed regression.(Eventualy Argument Clinic shouldmake a major speedup possible we could rewrite its code generator to produce tailor-madc argument parsing code,rather than calling the general-purpose CPython argument parsing library.That would make for the fastest argumentparsing possible t)Additionally.Argument Clinic must be flexible enough to work with any approach to argument parsing.Python hassomefunctionswithsomeverystrangeparsingbehaviors:ArgumentClinic'sgoalistosupportallofthem.Finally, the on ginal motivation for Argument Clinic was to provide introspection signatures for CPython builtinsIt used to be, the introspection query funcion s would throw an exception if you passed in abu it in.With ArgumentClinic, that'sa thing of the past!One idea you should keep in mind, as you work with Argument Clinic:the more information you give it, the belterjob itll he able to do.Argument Clinic is ad milt edly relatively simple rightnow, But as it evolves it will get moresophistical ed, and it should be able to do many interest ng and smart things with all the info m mation you give i2 Basic Concepts And Usage

Evrything i between these Iwo lies is input for Argument Clinic.All of these lies, including the beginning andending comment lines, are collectively called an Argument Clinic“blockWhen Argument Clinic parses one of these blocks, it generates output This output is rewritten into the C fileimmediately after the block, followed by a comment containing a checksum.The Argument Clinic block now lookslike this

If you run Argument Clinic on the same file a second time, Argument Clinic will discard the old output and writeout the new output with a fresh checksum line.However, if the input has n't changed, the output wont change cit herYou should never modify the output portion of an Argument Clinic block.Instead.change the input until it producesthe output you want(Thats the purpose of the checksum to detect if someone changed the output, as the seed iswould be lost the next lime Argument Clinic writes out fresh output.)For the sake of clarity, here's the terminology well use with Argument Clinic;·The last line of the initial comment([elini c start generated code] */) is the end line·The last line(/*Iclinicendgeneratedcode:checksum-.J*/) is the checksum line.·The first line of the comment(/*[elini c input] ) is the start linc·In between the start line and the end line is the input.·In between the end line and the checksum line is thc output/*icJ in ic input)·All the text collectively.from the start line to the checksum linc inclusively.is the block.(A block that hasntbeen successfully processed by Argument Clinic yet doesn't have output or a checksum line, but it's still con-sidered a block.)

3 Converting Your First FunctionThe best way to get a sense of how Argument Clinic works is to convert a function to work with it.Here, then, arethe bare minimum steps you'd need to follow to convert a function to work with Argument Clinic.Note that for codeyou plan to check into CPython, you really should take the conversion farther, using some of the adv unced conceptsyoull see later on in the document(like re tum converters and self converters, But well keep it simple for thiswalkthrough so you can leam.Lets dive in!


《Argument Clinic How-To》目录

计算机


python
AI人工智能
javascript
计算机网络/服务器
数据库技术
计算机F

考试教辅


考研考博
英语四六级

沪ICP备18046276号-5