We did the Catchakid net at the old house about and the net was used until our little guy was old enough. Then still put on if we were not going to be around.
I think code requirements, in addition to varying greatly by city, apply to overall access to the pool. So if your yard is fenced in, then that may meet the requirements.
If protecting your kid from drowning, then catchakid fence or net. And do swimming lessons, starting when they are infants.
"The absence of the word accountability is not the same as wanting no accountability" -unknown
"You can never go wrong by staying silent if there is nothing apt to say" -Walter Isaacson