per page, with , order by , clip by
Results of 1 - 10 of about 25 for wrapper (0.017 sec.)
functools --- 高階関数と呼び出し可能オブジェクトの操作 14645
functools --- 高階関数と呼び出し可能オブジェクトの操作 ソースコード: Lib/functools.py functools モジュールは、ほかの関数を操作したり返したりする高階関数のためのモジュールです。 一般に、このモジュールではあらゆる呼び出し可能オブジェクトを関数 ... taticmethod 、 @~abc.abstractmethod など、同様のデコレータにもこの方法を使えます。 Added in version 3.8. functools. update_wrapper ( wrapper , wrapped , assigned = WRAPPER_ASSIGNMENTS , updated = WRAPPER_UPDATES ) wrapper 関数を更新し、 wrapped 関数と同 ... たラッパー関数のどの属性を元の関数の同名の属性で更新するかを指定します。 これらの引数のデフォルト値はモジュールレベルの定数 WRAPPER_ASSIGNMENTS と WRAPPER_UPDATES です。 前者はラッパー関数の __module__ 、 __name__ 、 __qualname__ 、 __annotations__ 、 __ ... れる関数のメタデータは元の関数の定義ではなくラッパー関数の定義を反映してしまい、これは通常あまり有益ではありません。 update_wrapper() は、関数以外の呼び出し可能オブジェクトにも使えます。 assigned または updated で指名され、ラップされるオブジェクトに存在し ...
https://man.mtool.work/python/3.14/library/functools.html
Python で Curses プログラミング 10743
Python で Curses プログラミング Author : A.M. Kuchling, Eric S. Raymond Release : 2.04 概要 このドキュメントでは curses 拡張モジュールでテキストモードディスプレイを制御する方法について記述します。 curses ってなに? curses ライブラリは、VT100 ... 画面に表示されなくなり、シェルを使いにくくなります。 Pythonでは、これらの複雑さを避けデバッグをより容易にするために、 curses.wrapper() 関数をインポートして、このように使います: from curses import wrapper def main ( stdscr ): # 画面を消去する stdscr . clea ... i - 10 stdscr . addstr ( i , 0 , '10 divided by {} is {} ' . format ( v , 10 / v )) stdscr . refresh () stdscr . getkey () wrapper ( main ) wrapper() 関数は呼び出し可能オブジェクトを受け取り、上記の初期化を行います。 色がサポートされていれば、色の初期化 ... も行います。 その後、 wrapper() は渡された呼び出し可能オブジェクトを実行します。 その呼び出しから戻ると、 wrapper() は端末をもとの状態に戻します。 呼び出 ...
https://man.mtool.work/python/3.14/howto/curses.html
デスクリプタオブジェクト (descriptor object) 9929
デスクリプタオブジェクト (descriptor object) "デスクリプタ (descriptor)" は、あるオブジェクトのいくつかの属性について記述したオブジェクトです。デスクリプタオブジェクトは型オブジェクトの辞書内にあります。 PyTypeObject PyProperty_Type 次に属し ... クリプタは C 関数を型のメソッドとして公開し、Python の types.MethodDescriptorType オブジェクトに対応します。 PyTypeObject PyWrapperDescr_Type 次に属します: Stable ABI . The type object for wrapper descriptor objects created by PyDescr_NewWrapper() and Py ... Wrapper_New() . Wrapper descriptors are used internally to expose special methods such as __repr__ or __add__ , which are implemented by type slot ... s. The type is exposed in Python as types.WrapperDescriptorType . PyObject * PyDescr_NewWrapper ( PyTypeObject * type , struct wrapperbase * base , void * wrapped ) 戻り値: ...
https://man.mtool.work/python/3.14/c-api/descriptor.html
wsgiref --- WSGI ユーティリティとリファレンス実装 9514
wsgiref --- WSGI ユーティリティとリファレンス実装 ソースコード: Lib/wsgiref 警告 wsgiref はリファレンス実装であり、本番環境での使用は推奨されません。 このモジュールは基本的なセキュリティ検査だけを実装しています。 Web Server Gateway Interfac ... eader_name' が RFC 2616 で定義されている HTTP/1.1 の "Hop-by-Hop" ヘッダの場合に True を返します。 class wsgiref.util. FileWrapper ( filelike , blksize = 8192 ) A concrete implementation of the wsgiref.types.FileWrapper protocol used to convert a file-l ... 合には filelike オブジェクトの close() メソッドを呼び出します。 使用例: from io import StringIO from wsgiref.util import FileWrapper # ファイル類似オブジェクトとして StringIO バッファを使う。 filelike = StringIO ( "This is an example file-like object" * 1 ... 0 ) wrapper = FileWrapper ( filelike , blksize = 5 ) for chunk in wrapper : print ( chunk ) バージョン 3.11 で変更: __getitem__() メソ ...
https://man.mtool.work/python/3.14/library/wsgiref.html
Pythonモジュール索引 9514
Pythonモジュール索引 _ | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | z _ __future__ Future statement definitions __main__ The environment where top-level code is run. Covers command-line i ... tions. logging.config Configuration of the logging module. logging.handlers Handlers for the logging module. lzma A Python wrapper for the liblzma compression library. m mailbox Manipulate mailboxes in various formats mailcap 非推奨: Removed in 3.13. ma ... iprocessing Process-based parallelism. multiprocessing.connection API for dealing with sockets. multiprocessing.dummy Dumb wrapper around threading. multiprocessing.managers Share data between process with shared objects. multiprocessing.pool Create poo ... ework for network servers. spwd 非推奨: Removed in 3.13. sqlite3 A DB-API 2.0 implementation using SQLite 3.x. ssl TLS/SSL wrapper for socket objects stat Utilities for interpreting the results of os.stat(), os.lstat() and os.fstat(). statistics Mathema ...
https://man.mtool.work/python/3.14/py-modindex.html
textwrap --- テキストの折り返しと詰め込み 9298
textwrap --- テキストの折り返しと詰め込み ソースコード: Lib/textwrap.py textwrap モジュールは、実際の処理をすべて担う TextWrapper クラスと、いくつかの便利な関数を提供します。 1 つか 2 つの文字列を折り返したり詰め込んだりするだけなら、これら ... の関数で十分でしょう。 それ以外の場合は、効率のために TextWrapper のインスタンスを使ってください。 textwrap. wrap ( text , width = 70 , * , initial_indent = '' , subsequent_indent = '' , e ... なるように折り返します。 行末に改行文字を含まない出力行のリストを返します。 オプションのキーワード引数は、以下で説明する TextWrapper のインスタンス属性に対応しています。 wrap() の動作についての詳細は TextWrapper.wrap() メソッドを参照してください。 textwra ... . shorten ( "Hello world" , width = 10 , placeholder = "..." ) 'Hello...' オプションのキーワード引数は、以下で説明する TextWrapper インスタンスの属性に対応します。文字列が TextWrapper の fill() 関数に渡される前に、空白が折りたたまれます。そのため、 tabs ...
https://man.mtool.work/python/3.14/library/textwrap.html
What's New in Python 2.5 9298
What's New in Python 2.5 著者 : A.M. Kuchling この記事では Python 2.5 の新機能を説明します。 Python 2.5 の最終リリースは 2006 年 8 月に予定されており、 PEP 356 にリリース計画が記載されています。 Python 2.5 は 2006 年 9 月 19 日にリリースされ ... p_menu . append ( ( "Open" , open_func , 1 ) ) functools モジュールには、適切に振る舞うデコレーターを書くのに役立つ update_wrapper(wrapper, wrapped) 関数もあります。 update_wrapper() は、名前、モジュール、docstring の属性をラッパー関数へコピーし、ラップ ... した関数内のトレースバックを理解しやすくします。 例えば次のように書けます。 def my_decorator ( f ): def wrapper ( * args , ** kwds ): print 'Calling decorated function' return f ( * args , ** kwds ) functools . update_wrapper ( wrappe ... r , f ) return wrapper wraps() は、自作のデコレーターの内部で使い、ラップした関数の情報をコピーするためのデコレーターです。 前の例は次のようにも書 ...
https://man.mtool.work/python/3.14/whatsnew/2.5.html
デスクリプタ ガイド 8485
デスクリプタ ガイド Author : Raymond Hettinger Contact : <python at rcn dot com> デスクリプタ を使うと、オブジェクトの属性の検索、保存、削除をカスタマイズできます。 本ガイドは4つの大項目から構成されています。 最初の「入門」では基本の紹介をし ... od : "Objects/funcobject.c の PyStaticMethod_Type() を模擬する" def __init__ ( self , f ): self . f = f functools . update_wrapper ( self , f ) def __get__ ( self , obj , objtype = None ): return self . f def __call__ ( self , * args , ** kwds ): return ... self . f ( * args , ** kwds ) @property def __annotations__ ( self ): return self . f . __annotations__ functools.update_wrapper() を呼び出すと、元の関数を参照する __wrapped__ 属性が追加されます。 また、ラッパをラップ対象の関数と同じように見せるため、 ... hod : "Objects/funcobject.c の PyClassMethod_Type() を模擬する" def __init__ ( self , f ): self . f = f functools . update_wrapper ( self , f ) def __get__ ( self , obj , cls = None ): if cls is None : cls = type ( obj ) return MethodType ( self . f , c ...
https://man.mtool.work/python/3.14/howto/descriptor.html
curses --- 文字セル表示のターミナル処理 8070
curses --- 文字セル表示のターミナル処理 ソースコード: Lib/curses curses モジュールは、移植可能な高度な端末処理の事実上の標準である curses ライブラリへのインターフェースを提供します。 curses が最も広く用いられているのは Unix 環境ですが、Wind ... れた lines および columns の値を使います。 curses. use_default_colors ( ) assume_default_colors(-1, -1) と等価です。 curses. wrapper ( func , / , * args , ** kwargs ) curses を初期化し、呼び出し可能なオブジェクト func (その他の curses を使用するアプリケー ... 、トレースバックを作成します。その後、呼び出し可能オブジェクト func には、第一引数としてメインウィンドウ 'stdscr' が、続いて wrapper() に渡されたその他の引数が渡されます。 func を呼び出す前、 wrapper() は cbreak モードをオンに、エコーをオフに、端末キーパッ ... が False の場合、エスケープシーケンスは入力ストリーム内にそのまま残されます。 キーパッドモードはデフォルトでは無効ですが、 wrapper() はメインウィンドウに対して有効にします。 window. leaveok ( flag ) flag が True の場合、更新時にカーソルを「カーソル位置」 ...
https://man.mtool.work/python/3.14/library/curses.html
What's New in Python 2.4 7870
What's New in Python 2.4 著者 : A.M. Kuchling この文書は 2005 年 3 月 30 日にリリースされた Python 2.4.1 の新機能について解説します。 Python 2.4 は、真ん中サイズ、のリリースです。急進的だった Python 2.2 ほどには多くの変更をしていませんが、保 ... け現実的な例として、続く例ではデコレータに、与えられた引数が整数かどうかチェックさせてみます: def require_int ( func ): def wrapper ( arg ): assert isinstance ( arg , int ) return func ( arg ) return wrapper @require_int def p1 ( arg ): print arg @requir ... りました。 (Raymond Hettinger による貢献です。) list.__getitem__() 、 dict.__getitem__() 、 dict.__contains__() メソッドは、 wrapper_descriptor ではなく method_descriptor オブジェクトとして実装されるようになりました。 このアクセス方式で性能が 2 倍になり、 ...
https://man.mtool.work/python/3.14/whatsnew/2.4.html
PREV 1 2 3 NEXT