Closed kmr-srbh closed 6 months ago
It looks good to me. Thanks for this. Please resolve the conflicts and I will take a look again.
Sure @Shaikh-Ubaid! These are due to the latest additions to main which made changes to the intrinsic function files. I am making the changes.
This is getting difficult to resolve as new files were added. It would be easier to open a new PR.
The official Python documentation describes
set.discard(elem)
as:and
set.remove(elem)
as:Hence, it is obvious that both the functions do the same work, but differ only with throwing an error for an absent key. As we already had the infrastructure for
set.remove
, it was easy to base and implementset.discard
on top of that.The idea is simple - utilize the same back-end function, but do not throw an error for
set.discard
.Working
The KeyError for
set.remove
proves the normal working ofset.discard
.Handling KeyError
set.discard
set.remove