The American Academy of Pediatrics found for many years that it was difficult to answer the question of "Is my child less likely to drown if they have taken swim lessons?". That might seem like the answer would be "Of course they are safer if they have had swim lessons." However, for a long time, it was not known for sure if that was true. And a long time worry has been whether parents and guardians could drop their guard about the child swimming if the parent and guardian knew that the child had swimming lessons.
Here is the Healthy Children's website about drowning prevention and swim safety. And here is another good webpage about the same subject. From the same website, here is an audio piece to listen to about infant and toddler swimming lessons. One last link -- this directly from the American Academy of Pediatrics.
So I do think swim lessons are fine for young toddlers. Formal swim lessons for children 4 years of age and above are a good idea. BUT never let your guard down. Even with good swimmers. Do not assume someone else is supervising your child while they are in the water.