# Deleting constraints strange behavior

**URL:** <https://discourse.julialang.org/t/deleting-constraints-strange-behavior/50324>\
**Category:** General Usage\
**Created:** [November 17, 2020, 7:59pm UTC](https://discourse.julialang.org/t/deleting-constraints-strange-behavior/50324 "2020-11-17T19:59:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![J\_Friedman](https://avatars.discourse-cdn.com/v4/letter/j/7993a0/32.png) [@J\_Friedman](https://discourse.julialang.org/u/J_Friedman)\
**Post date:** [November 17, 2020, 7:59pm UTC](https://discourse.julialang.org/t/deleting-constraints-strange-behavior/50324/1 "2020-11-17T19:59:03Z")

</div>

Why is it that when one deletes an object from a model, it keeps the variable attached?

@constraint(model, con, 2x \<= 1)  
delete(model, con)  
@constraint(model, con, 2x \<= 1)  
ERROR: An object of name con is already attached to this model. If this is intended, consider using the anonymous construction syntax, e.g., x = @variable(model, [1:N], …) where the name of the object does not appear inside the macro.
