当前位置: 首页>>代码示例>>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;未经允许,请勿转载。