當前位置: 首頁>>代碼示例>>Python>>正文


Python util.immutabledict方法代碼示例

本文整理匯總了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,
        ) 
開發者ID:laughingman7743,項目名稱:PyAthena,代碼行數:18,代碼來源:sqlalchemy_athena.py

示例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) 
開發者ID:mxmzdlv,項目名稱:pybigquery,代碼行數:7,代碼來源:sqlalchemy_bigquery.py

示例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) 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:8,代碼來源:test_utils.py

示例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) 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:9,代碼來源:test_utils.py

示例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}) 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:14,代碼來源:test_utils.py

示例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}) 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:9,代碼來源:test_utils.py

示例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}) 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:10,代碼來源:test_utils.py

示例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}) 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:6,代碼來源:test_utils.py

示例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}) 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:6,代碼來源:test_utils.py

示例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)}) 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:6,代碼來源:test_utils.py

示例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 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:7,代碼來源:test_utils.py

示例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) 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:12,代碼來源:test_utils.py


注:本文中的sqlalchemy.util.immutabledict方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。