per page, with , order by , clip by
Results of 1 - 10 of about 38 for operator (0.006 sec.)
operator --- 関数形式の標準演算子 16400
operator --- 関数形式の標準演算子 ソースコード: Lib/operator.py operator モジュールは、Python の組み込み演算子に対応する効率的な関数を提供します。 例えば、 operator.add(x, y) は式 x+y と同等です。 多くの関数名は、特殊メソッドの名前から二重ア ... に分類されます。 オブジェクト比較関数は全てのオブジェクトで有効で、関数の名前はサポートする拡張比較演算子からとられています: operator. lt ( a , b ) operator. le ( a , b ) operator. eq ( a , b ) operator. ne ( a , b ) operator. ge ( a , b ) operator. gt ( a ... , b ) operator. __lt__ ( a , b ) operator. __le__ ( a , b ) operator. __eq__ ( a , b ) operator. __ne__ ( a , b ) operator. __ge__ ( a , ... b ) operator. __gt__ ( a , b ) a と b の "拡張比較 (rich comparisons)" を行います。具体的には、 lt(a, b) は a < b 、 le(a, b) は a <= b ...
https://man.mtool.work/python/3.14/library/operator.html
numbers --- 数の抽象基底クラス 11368
numbers --- 数の抽象基底クラス ソースコード: Lib/numbers.py numbers モジュール ( PEP 3141 ) は、下位になるほど多くの演算を定義する、数値の 抽象基底クラス の階層を定義しています。 このモジュールで定義する型は、どれもインスタンス化を目的とした ... と反射演算のメソッドを生成するヘルパー関数を定義すると便利です。 例えば fractions.Fraction では、次のようにしています。 def _operator_fallbacks ( monomorphic_operator , fallback_operator ): def forward ( a , b ): if isinstance ( b , ( int , Fraction )): re ... turn monomorphic_operator ( a , b ) elif isinstance ( b , float ): return fallback_operator ( float ( a ), b ) elif isinstance ( b , complex ): retu ... rn fallback_operator ( complex ( a ), b ) else : return NotImplemented forward . __name__ = '__' + fallback_operator . __name__ + '__' forward ...
https://man.mtool.work/python/3.14/library/numbers.html
関数型プログラミング HOWTO 9025
関数型プログラミング HOWTO Author : A. M. Kuchling Release : 0.32 この文書では、関数型スタイルでプログラムを実装するのにピッタリな Python の機能を見てまわることにしましょう。まず関数型プログラミングという概念を紹介したあと、 iterator や gen ... , 4 , 5 , 6 , 7 , 8 , 9 , ... また iterB -> 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , ... 要素に対して関数を呼ぶ いま使った operator モジュールには、Python の演算子に対応する関数が入っています。いくつか例を挙げると、 operator.add(a, b) (二つの値を加算)、 ... operator.ne(a, b) ( a != b と同じ)、 operator.attrgetter('id') ( .id 属性を取得するコーラブルを返す) といった関数です。 itertools.starmap(func, iter) は、イテラブルがタ ... Error が送出されます。 初期値を指定した場合は、それを出発点にして、最初に func(initial_value, A) を計算します。 >>> import operator , functools >>> functools . reduce ( operator . concat , [ 'A' , 'BB' , 'C' ]) 'ABBC' >>> functools . reduce ( operator . ...
https://man.mtool.work/python/3.14/howto/functional.html
関数型プログラミング用モジュール 8459
関数型プログラミング用モジュール この章で説明するモジュールは、関数型プログラミングのスタイルをサポートする関数やクラスと、呼び出し可能オブジェクトに対する汎用的な操作を提供します。 この章では以下のモジュールが記述されています: itertools -- ... テレータ生成関数群 Itertool関数 Itertools レシピ functools --- 高階関数と呼び出し可能オブジェクトの操作 partial オブジェクト operator --- 関数形式の標準演算子 演算子から関数への対応表 インプレース (in-place) 演算子 他のマニュアルの関連ページ Linux JM prece ... dence(7) Linux JM operator(7) PHP about.more Django 1.4.12 Django 1.5.7 PHP language.operators ...
https://man.mtool.work/python/3.14/library/functional.html
ソートのテクニック 8034
ソートのテクニック Author : Andrew Dalke and Raymond Hettinger Python のリストにはリストをインプレースに変更する、組み込みメソッド list.sort() があります。他にもイテラブルからソートしたリストを作成する組み込み関数 sorted() があります。 この ... た属性を持つオブジェクトは上で示したとおり通常のクラスから作れますし、 dataclass や named tuple のインスタンスでもよいです。 operator モジュールの関数や partial 関数による評価 上で示した key function パターンは非常に一般的なので、Python はアクセサ関数を簡単 ... に速く作れる便利な関数を提供しています。 operator モジュールに itemgetter() 、 attrgetter() 、および methodcaller() 関数があります。 これらの関数を利用すると、上の例はもっと ... 簡単で高速になります: >>> from operator import itemgetter , attrgetter >>> sorted ( student_tuples , key = itemgetter ( 2 )) [('dave', 'B', 10), ('jane', 'B', 12) ...
https://man.mtool.work/python/3.14/howto/sorting.html
2. 字句解析 7987
2. 字句解析 Python プログラムは パーザ によって読み取られます。 パーザへの入力は、 字句解析器 (または トークナイザ ) が生成した トークン の列です。 この章では、字句解析器がこれらのトークンを生成する方法を説明します。 字句解析器はプログラムの ... OP トークン型を定義します。 token モジュールのドキュメントにも これらのトークンと名前の一覧 があります。 OP : | assignment_operator | bitwise_operator | comparison_operator | enclosing_delimiter | other_delimiter | arithmetic_operator | "..." | other_op ... assignment_operator : "+=" | "-=" | "*=" | "**=" | "/=" | "//=" | "%=" | "&=" | "|=" | "^=" | "<<=" | ">>=" | "@=" | ":=" bitwise_operator : " ... &" | "|" | "^" | "~" | "<<" | ">>" comparison_operator : "<=" | ">=" | "<" | ">" | "==" | "!=" enclosing_delimiter : "(" | ")" | "[" | "]" | "{" | "}" other_delimiter : "," | ": ...
https://man.mtool.work/python/3.14/reference/lexical_analysis.html
itertools --- 効率的なループ用のイテレータ生成関数群 7846
itertools --- 効率的なループ用のイテレータ生成関数群 このモジュールは イテレータ を構築する部品を実装しています。プログラム言語 APL, Haskell, SML からアイデアを得ていますが、 Python に適した形に修正されています。 このモジュールは、高速でメモ ... から累積を開始し、出力は入力のイテラブルより 1 要素多くなります。 およそ次と等価です: def accumulate ( iterable , function = operator . add , * , initial = None ): '累積値を返す' # accumulate([1,2,3,4,5]) → 1 3 6 10 15 # accumulate([1,2,3,4,5], initial=100 ... ) → 100 101 103 106 110 115 # accumulate([1,2,3,4,5], operator.mul) → 1 2 6 24 120 iterator = iter ( iterable ) total = initial if initial is None : try : total = next ( iterator ) exce ... ment ) yield total それまでの最小値を求めるには、 function に min() を指定します。 それまでの最大値には max() 、累積積には operator.mul() を指定します。 返済予定表 を作成するには、利息を加算して返済額を差し引きます。 >>> data = [ 3 , 4 , 6 , 2 , 1 , 9 , ...
https://man.mtool.work/python/3.14/library/itertools.html
bisect --- 配列二分法アルゴリズム 7610
bisect --- 配列二分法アルゴリズム ソースコード: Lib/bisect.py このモジュールは、挿入のたびにリストをソートすることなく、ソートされた順序でリストを維持するためのサポートを提供します。 コストのかかる比較演算を伴う長いリストの場合、これは線形検 ... 引数 key はテーブルのレコードの順序付けに使用されるフィールドを抽出します: >>> from collections import namedtuple >>> from operator import attrgetter >>> from bisect import bisect , insort >>> from pprint import pprint >>> Movie = namedtuple ( 'Movie' , ... = [( 'red' , 5 ), ( 'blue' , 1 ), ( 'yellow' , 8 ), ( 'black' , 0 )] >>> data . sort ( key = lambda r : r [ 1 ]) # または operator.itemgetter(1) を使う。 >>> keys = [ r [ 1 ] for r in data ] # キーのリストを事前に計算する。 >>> data [ bisect_left ( keys ...
https://man.mtool.work/python/3.14/library/bisect.html
tokenize --- Python ソース用のトークナイザー 7610
tokenize --- Python ソース用のトークナイザー ソースコード: Lib/tokenize.py The tokenize module provides a lexical scanner for Python source code, implemented in Python. The scanner in this module returns comments as tokens as well, making i ... ul for implementing "pretty-printers", including colorizers for on-screen displays. To simplify token stream handling, all operator and delimiter tokens and Ellipsis are returned using the generic OP token type. The TokenInfo.exact_type property gives th ... version 3.1. type An integer identifying the token type, as defined by the constants in token , such as NAME and STRING . Operators and delimiters have type OP ; use exact_type for their specific token type. string The token text as a str . For STRING t ... ontain several source lines. It is empty for ENCODING and ENDMARKER tokens. exact_type An integer identifying the specific operator type for OP tokens, as defined by the constants in token . For all other token types, this equals type . For example, a + ...
https://man.mtool.work/python/3.14/library/tokenize.html
Python ドキュメントの目次 7563
Python ドキュメントの目次 What's New in Python What's new in Python 3.14 概要 -- リリースハイライト 新しい機能 PEP 649 と PEP 749 : アノテーションの遅延評価 PEP 734 : 複数インタープリタ機能が標準ライブラリに追加 PEP 750 : テンプレート文字列 ... getopt getpass graphlib heapq hmac http imaplib inspect io json linecache logging.handlers math mimetypes multiprocessing operator os os.path pathlib pdb pickle platform pydoc re socket ssl struct symtable sys sys.monitoring sysconfig tarfile threading ... contextlib データクラス datetime enum fcntl fractions functools gzip hashlib IDLE と idelelib inspect locale logging math operator os pathlib re shutil socket sqlite3 string sys sysconfig tempfile threading time tkinter traceback typing unicodedata unit ... ient idlelib と IDLE imaplib imghdr importlib inspect io ipaddress json linecache locale logging lzma math multiprocessing operator os pathlib pickle poplib re readline selectors shutil signal smtpd smtplib sndhdr socket ssl メモリ BIO サポート Applicati ...
https://man.mtool.work/python/3.14/contents.html
PREV 1 2 3 4 NEXT