What is the difference between arguments and parameters?

本文详细解释了在Python中函数定义中的参数(parameters)与调用函数时传递的实参(arguments)之间的区别。通过一个具体的例子展示了如何定义带有默认值参数及关键字参数的函数,并说明了这些参数在实际调用时是如何被具体值所替代的。

https://docs.python.org/3/faq/programming.html#what-is-the-difference-between-arguments-and-parameters

Parameters are defined by the names that appear in a function definition, whereas arguments are the values actually passed to a function when calling it. Parameters define what types of arguments a function can accept. For example, given the function definition:

def func(foo, bar=None, **kwargs):
    pass

foobar and kwargs are parameters of func. However, when calling func, for example:

func(42, bar=314, extra=somevar)

the values 42314, and somevar are arguments.


简而言之:arguments是实参,parameters是形参。阅读英文文档有点帮助。



规则文件中的所有长度值均以用Precision Specification statement Defines the ratio of database units to user units. Usage PRECISION { number | {integer1 integer2} } Arguments • number | {integer1 integer2} A required argument choice that specifies the precision. number — A positive, floating-point value that specifies the database precision. integer1 integer2 — Two positive integers, where the quotient integer2/integer1 is the precision. Description Defines the ratio of database units to user units. A database unit (dbu) is the unit measure of length for the input database. This statement is optional and can appear once in a rule file. In Calibre, the default Precision is 1000. This is the reciprocal of the common layout database precision of 0.001. All numeric values of length within a rule file are in user units. However, when a rule file is compiled, user units are converted into an equivalent number of database units by multiplying the user units by the number specified in the Precision statement. For example, if you assume a user unit of microns, and if your rule file Precision is 1000, this implies there are 1000 dbu per micron. This statement affects the precision with which length measurements are taken. For example, Precision 1000 enables measurements to be taken to the nearest 0.001 user unit, whereas if your rule file Precision is 100, measurements are taken to the nearest 0.01 user unit. If your database precision does not match the rule file Precision, a compiler error results.You can override this error with the Layout Input Exception Severity PRECISION_RULE_FILE 1 setting, which allows the condition but issues a warning. If you choose to override the error, then the rule file Precision is used, and the data is scaled up or down according to the Precision you specify. For example, if your database precision is 0.001 and your rule file Precision is 10000, then layout polygon coordinates are scaled down by a factor of 10. You can specify the value of the database precision separately by using the Layout Precision statement. The Layout Path and Layout Path2 statements using the PREC keyword serve the same purpose. If you specify any of these statements, the values they contain are used to verify the input database precision rather than the Precision statement value. This method is used for verifying the database precision only; it does not change the measurement precision used during For most applications, specifying number as an integer value is desirable; non-integer values are rarely used. If A and B are integers, specifying Precision A B is equivalent to Precision (B/ A). For example, Precision 10 1000 is equivalent to Precision 100. The number, integer1, and integer2 parameters may be names associated with numeric-valued environment variables. In this case, the value of the variable is resolved in the shell environment. If the variable cannot be resolved properly, the ENV1 or ENV2 compiler error is generated. Additionally, the values assigned to these parameters define the values for the system variables $PRECISION, $PRECISION_N, and $PRECISION_D, respectively. See the Variable statement for more information on system variables and declaring environment variables. The Layout Polygon, Polygon, Layout Text, and Text specification statements do not have their objects’ coordinates scaled up or down when you change your Precision setting. Coordinates specified in these statements are always interpreted in absolute user units. This can have unexpected results for some users. For example, if you have the following in your rule file: PRECISION 1000 POLYGON 0 0 1 1 layer1 This places a square object with opposing corners at vertices (0, 0) (1, 1) on layer1, with the coordinates in microns. If you change the Precision to 2000 (effectively scaling the database down by half as it is read in) but leave the Polygon statement unchanged, this results in the square having corners at (0, 0) (1, 1), not (0, 0) (0.5, 0.5) as would be the case for a layout database polygon. This is so that the polygon has the stated dimensions of 1 × 1 user units. Any further scaling of the square (such as with the Layout Magnify statement) is applied in the usual way. By default, DRC results written to the Calibre nmDRC results database are written with the same Precision as what is specified in the rule file. You can change the precision of the results database by using the DRC Results Database Precision specification statement. As indicated previously, any scaling performed by the Layout Magnify specification statement is in addition to any scaling that occurs due to a difference between your rule file Precision and your database precision. If writing out mask data and magnifying the layout by a value that is less than 1 (such as for Layout Magnify or DRC Magnify Results), it is recommended that the output database precision be greater than the input physical precision by a factor of 10. This reduces the number of gaps in layers due to grid snapping. The output database precision follows the Precision statement setting by default. In Pyxis Layout, the number parameter and the value of the $precision Process variable must match; otherwise ICrules generates a compiler error. If you do not include the Precision statement in a rule file, the default database precision is equal to the value of the $precision Process variable. To check your user grid, see Resolution.See “Layout Magnification” in the Calibre Solutions for Physical Verification manual for a complete discussion of precision and magnification effects. See also Layout Use Database Precision and DRC Magnify Results. Examples Example 1 If your database precision is 0.001 and your user unit of length is microns (1E-06 m), setting a rule file Precision of 1000 implies the database unit is nanometers (1E-09 m). PRECISION 1000 // 1000 database units to 1 user unit; dbu = nanometer Changing the rule file Precision to 10000 implies a scaling down of the database by a factor of 10, and a measurement precision of 0.0001 microns. To compensate, you could magnify the layout by a factor of 10: // Layout precision is 0.001 LAYOUT INPUT EXCEPTION SEVERITY PRECISION_RULE_FILE 1 // database precision and rule file PRECISION do not match PRECISION 10000 // database scaled down by factor of 10 LAYOUT MAGNIFY 10 // keep data at original scale Or you can do this: PRECISION 10000 //scale down by factor of 10 LAYOUT PRECISION 1000 //specify the expected database precision LAYOUT MAGNIFY AUTO //automatically magnify by factor of 10000/1000 Additional related examples are found under Layout Magnify and DRC Magnify Results. Example 2 This example shows how to scale mask data by 50%: LAYOUT PRECISION 1000 PRECISION 10000 // increase precision by a factor of 10 // to reduce grid snapping; data scaled by 1/10 LAYOUT MAGNIFY 5 // use a 0.5 magnification The output data has the same physical precision as the Precision statement by default. 先翻译后解释
01-07
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值