本文整理匯總了Python中sqlalchemy.util.immutabledict方法的典型用法代碼示例。如果您正苦於以下問題:Python util.immutabledict方法的具體用法?Python util.immutabledict怎麽用?Python util.immutabledict使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sqlalchemy.util
的用法示例。
在下文中一共展示了util.immutabledict方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from sqlalchemy import util [as 別名]
# 或者: from sqlalchemy.util import immutabledict [as 別名]
def __init__(
self,
dialect,
statement,
bind=None,
schema_translate_map=None,
compile_kwargs=util.immutabledict(),
):
self._preparer = AthenaDDLIdentifierPreparer(dialect)
super(AthenaDDLCompiler, self).__init__(
dialect=dialect,
statement=statement,
bind=bind,
schema_translate_map=schema_translate_map,
compile_kwargs=compile_kwargs,
)
示例2: __init__
# 需要導入模塊: from sqlalchemy import util [as 別名]
# 或者: from sqlalchemy.util import immutabledict [as 別名]
def __init__(self, dialect, statement, column_keys=None,
inline=False, **kwargs):
if isinstance(statement, Column):
kwargs['compile_kwargs'] = util.immutabledict({'include_table': False})
super(BigQueryCompiler, self).__init__(dialect, statement, column_keys, inline, **kwargs)
示例3: test_union_no_change
# 需要導入模塊: from sqlalchemy import util [as 別名]
# 或者: from sqlalchemy.util import immutabledict [as 別名]
def test_union_no_change(self):
d = util.immutabledict({1: 2, 3: 4})
d2 = d.union({})
is_(d2, d)
示例4: test_merge_with_no_change
# 需要導入模塊: from sqlalchemy import util [as 別名]
# 或者: from sqlalchemy.util import immutabledict [as 別名]
def test_merge_with_no_change(self):
d = util.immutabledict({1: 2, 3: 4})
d2 = d.merge_with({}, None)
eq_(d2, {1: 2, 3: 4})
is_(d2, d)
示例5: test_merge_with_dicts
# 需要導入模塊: from sqlalchemy import util [as 別名]
# 或者: from sqlalchemy.util import immutabledict [as 別名]
def test_merge_with_dicts(self):
d = util.immutabledict({1: 2, 3: 4})
d2 = d.merge_with({3: 5, 7: 12}, {9: 18, 15: 25})
eq_(d, {1: 2, 3: 4})
eq_(d2, {1: 2, 3: 5, 7: 12, 9: 18, 15: 25})
assert isinstance(d2, util.immutabledict)
d3 = d.merge_with({17: 42})
eq_(d3, {1: 2, 3: 4, 17: 42})
示例6: test_merge_with_tuples
# 需要導入模塊: from sqlalchemy import util [as 別名]
# 或者: from sqlalchemy.util import immutabledict [as 別名]
def test_merge_with_tuples(self):
d = util.immutabledict({1: 2, 3: 4})
d2 = d.merge_with([(3, 5), (7, 12)], [(9, 18), (15, 25)])
eq_(d, {1: 2, 3: 4})
eq_(d2, {1: 2, 3: 5, 7: 12, 9: 18, 15: 25})
示例7: test_union_dictionary
# 需要導入模塊: from sqlalchemy import util [as 別名]
# 或者: from sqlalchemy.util import immutabledict [as 別名]
def test_union_dictionary(self):
d = util.immutabledict({1: 2, 3: 4})
d2 = d.union({3: 5, 7: 12})
assert isinstance(d2, util.immutabledict)
eq_(d, {1: 2, 3: 4})
eq_(d2, {1: 2, 3: 5, 7: 12})
示例8: test_keys
# 需要導入模塊: from sqlalchemy import util [as 別名]
# 或者: from sqlalchemy.util import immutabledict [as 別名]
def test_keys(self):
d = util.immutabledict({1: 2, 3: 4})
eq_(set(d.keys()), {1, 3})
示例9: test_values
# 需要導入模塊: from sqlalchemy import util [as 別名]
# 或者: from sqlalchemy.util import immutabledict [as 別名]
def test_values(self):
d = util.immutabledict({1: 2, 3: 4})
eq_(set(d.values()), {2, 4})
示例10: test_items
# 需要導入模塊: from sqlalchemy import util [as 別名]
# 或者: from sqlalchemy.util import immutabledict [as 別名]
def test_items(self):
d = util.immutabledict({1: 2, 3: 4})
eq_(set(d.items()), {(1, 2), (3, 4)})
示例11: test_contains
# 需要導入模塊: from sqlalchemy import util [as 別名]
# 或者: from sqlalchemy.util import immutabledict [as 別名]
def test_contains(self):
d = util.immutabledict({1: 2, 3: 4})
assert 1 in d
assert "foo" not in d
示例12: test_rich_compare
# 需要導入模塊: from sqlalchemy import util [as 別名]
# 或者: from sqlalchemy.util import immutabledict [as 別名]
def test_rich_compare(self):
d = util.immutabledict({1: 2, 3: 4})
d2 = util.immutabledict({1: 2, 3: 4})
d3 = util.immutabledict({5: 12})
d4 = {5: 12}
eq_(d, d2)
ne_(d, d3)
ne_(d, d4)
eq_(d3, d4)