internal override bool TrySetValue(CodeContext context, object instance, PythonType owner, object value)
        {
            IPythonObject sdo = instance as IPythonObject;

            if (sdo != null)
            {
                if (!(value is PythonDictionary))
                {
                    throw PythonOps.TypeError("__dict__ must be set to a dictionary, not '{0}'", owner.Name);
                }

                if (!sdo.PythonType.HasDictionary)
                {
                    return(false);
                }

                sdo.ReplaceDict((PythonDictionary)value);
                return(true);
            }

            if (instance == null)
            {
                throw PythonOps.AttributeError("'__dict__' of '{0}' objects is not writable", owner.Name);
            }
            return(false);
        }
        internal override bool TryDeleteValue(CodeContext context, object instance, PythonType owner)
        {
            IPythonObject sdo = instance as IPythonObject;

            if (sdo != null)
            {
                if (!sdo.PythonType.HasDictionary)
                {
                    return(false);
                }

                sdo.ReplaceDict(null);
                return(true);
            }

            if (instance == null)
            {
                throw PythonOps.TypeError("'__dict__' of '{0}' objects is not writable", owner.Name);
            }
            return(false);
        }