Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nucleic/enaml
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7d965543afddfcbb7a9d9d87dcc7c912802d31a9
Choose a base ref
..
head repository: nucleic/enaml
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5b9f191b2ab11e4c08099db2c24d7935a512a7f5
Choose a head ref
Showing with 11 additions and 11 deletions.
  1. +4 −4 enaml/core/dynamicscope.py
  2. +6 −6 enaml/src/dynamicscope.cpp
  3. +1 −1 tests/core/test_dynamicscope.py
8 changes: 4 additions & 4 deletions enaml/core/dynamicscope.py
Original file line number Diff line number Diff line change
@@ -48,11 +48,11 @@ def keys(self):
return iter(self)

def values(self):
return tuple(self[key] for key in self)
return (self[key] for key in self)

def items(self):
return tuple((key, self[key]) for key in self)
return ((key, self[key]) for key in self)

def update(self, value):
for key, value in value.items():
def update(self, state):
for key, value in state.items():
self[key] = value
12 changes: 6 additions & 6 deletions enaml/src/dynamicscope.cpp
Original file line number Diff line number Diff line change
@@ -787,7 +787,7 @@ DynamicScope_contains( DynamicScope* self, PyObject* key )

PyObject* DynamicScope_get_owner( DynamicScope* self )
{
return cppy::incref(self->owner );
return cppy::incref( self->owner );
}


@@ -799,25 +799,25 @@ PyObject* DynamicScope_get_change( DynamicScope* self )

PyObject* DynamicScope_get_f_locals( DynamicScope* self )
{
return cppy::incref(self->f_locals );
return cppy::incref( self->f_locals );
}


PyObject* DynamicScope_get_f_globals( DynamicScope* self )
{
return cppy::incref(self->f_globals );
return cppy::incref( self->f_globals );
}


PyObject* DynamicScope_get_f_builtins( DynamicScope* self )
{
return cppy::incref(self->f_builtins );
return cppy::incref( self->f_builtins );
}


PyObject* DynamicScope_get_f_writes( DynamicScope* self )
{
return cppy::incref(self->f_writes ? self->f_writes : Py_None );
return cppy::incref( self->f_writes ? self->f_writes : Py_None );
}

static PyGetSetDef
@@ -826,7 +826,7 @@ DynamicScope_getset[] = {
{ "_change", ( getter )DynamicScope_get_change, 0, "Get change." },
{ "_f_locals", ( getter )DynamicScope_get_f_locals, 0, "Get f_locals." },
{ "_f_globals", ( getter )DynamicScope_get_f_globals, 0, "Get f_globals." },
{ "_f_builtins", ( getter )DynamicScope_get_f_builtins, 0, "Get f_builtins."},
{ "_f_builtins", ( getter )DynamicScope_get_f_builtins, 0, "Get f_builtins." },
{ "_f_writes", ( getter )DynamicScope_get_f_writes, 0, "Get f_writes." },
{ 0 } // sentinel
};
2 changes: 1 addition & 1 deletion tests/core/test_dynamicscope.py
Original file line number Diff line number Diff line change
@@ -286,7 +286,7 @@ def test_dynamicscope_mapping(dynamicscope):
owner.__class__.non_data_key_raise.should_raise = False

parent = owner._parent
values = dynamicscope.values()
values = list(dynamicscope.values())
for v in (0, 1, 2, 3, 5, owner, change, parent):
assert v in values