Movatterモバイル変換
[0]ホーム
6.6.1partial Objects
partial objects are callable objects created bypartial().They have three read-only attributes:
- func
- A callable object or function. Calls to thepartial object willbe forwarded tofunc with new arguments and keywords.
- args
- The leftmost positional arguments that will be prepended to thepositional arguments provided to apartial object call.
- keywords
- The keyword arguments that will be supplied when thepartial objectis called.
partial objects are likefunction objects in that they arecallable, weak referencable, and can have attributes. There are someimportant differences. For instance, the__name__ and__doc__ attributes are not created automatically. Also,partial objects defined in classes behave like static methods anddo not transform into bound methods during instance attribute look-up.
Release 2.5.2, documentation updated on 21st February, 2008. SeeAbout this document... for information on suggesting changes.
[8]ページ先頭