Results of 1 - 4 of about 4 for dept (0.006 sec.)
- デスクリプタ ガイド 11742
- デスクリプタ ガイド Author : Raymond Hettinger Contact : <python at rcn dot com> デスクリプタ を使うと、オブジェクトの属性の検索、保存、削除をカスタマイズできます。 本ガイドは4つの大項目から構成されています。 最初の「入門」では基本の紹介をし
...able objects where descriptors manage access to private attributes stored in __slots__ : class Immutable : __slots__ = ( '_dept' , '_name' ) # インスタンス辞書を置き換える def __init__ ( self , dept , name ): self . _dept = dept # プライベート属性に格...納する self . _name = name # プライベート属性に格納する @property # 読み取り専用のデスクリプタ def dept ( self ): return self . _dept @property def name ( self ): # 読み取り専用のデスクリプタ return self . _name >>> mark = Imm...utable ( 'Botany' , 'Mark Watney' ) >>> mark . dept 'Botany' >>> mark . dept = 'Space Pirate' Traceback (most recent call last): ... AttributeError : property 'dept' of 'Immu... - https://man.mtool.work/python/3.14/howto/descriptor.html
- What's New In Python 3.1 10263
- What's New In Python 3.1 著者 : Raymond Hettinger この記事では Python 3.0 と比較した Python 3.1 の新機能を説明します。 Python 3.1 は 2009 年 6 月 27 日にリリースされました。 PEP 372: 順序付き辞書 通常の Python 辞書は、 key/value ペアを不定の
...場合に有用です。例えば CSV のヘッダ、SQL のフィールドリスト、あるいはユーザ入力などです: >>> query = input () SELECT region, dept, count(*) FROM main GROUPBY region, dept >>> cursor . execute ( query ) >>> query_fields = [ desc [ 0 ] for desc in cursor...query_fields , rename = True ) >>> pprint . pprint ([ UserQuery ( * row ) for row in cursor ]) [UserQuery(region='South', dept='Shipping', _2=185), UserQuery(region='North', dept='Accounting', _2=37), UserQuery(region='West', dept='Sales', _2=419)]... - https://man.mtool.work/python/3.14/whatsnew/3.1.html
- What's New In Python 3.2 7618
- What's New In Python 3.2 著者 : Raymond Hettinger この記事では Python 3.1 と比較した Python 3.2 の新機能を説明します。 Python 3.2 は 2011 年 2 月 20 日にリリースされました。 主な変更点をいくつか取り上げ、例を示します。 すべての詳細については
...キュメントのフィールド名に書き出すのに使用します: >>> import csv , sys >>> w = csv . DictWriter ( sys . stdout , [ 'name' , 'dept' ], dialect = 'unix' ) >>> w . writeheader () "name","dept" >>> w . writerows ([ ... { 'name' : 'tom' , 'dept' : 'accounti...ng' }, ... { 'name' : 'susan' , 'dept' : 'Salesl' }]) "tom","accounting" "susan","sales" (New dialect suggested by Jay Talbot in bpo-5975 , and the new method s... - https://man.mtool.work/python/3.14/whatsnew/3.2.html
- 9. クラス 7323
- 9. クラス クラスはデータと機能を組み合わせる方法を提供します。 新規にクラスを作成することで、新しいオブジェクトの 型 を作成し、その型を持つ新しい インスタンス が作れます。 クラスのそれぞれのインスタンスは自身の状態を保持する属性を持てます。
...では、この用途に dataclasses を使うのが一般的です。 from dataclasses import dataclass @dataclass class Employee : name : str dept : str salary : int >>> john = Employee ( 'john' , 'computer lab' , 1000 ) >>> john . dept 'computer lab' >>> john . salary... - https://man.mtool.work/python/3.14/tutorial/classes.html
PREV
1
NEXT