The first, a snake, is ruled by the nomenclature code for animals, where this is allowed.
The second, a hypothetical fungus, is ruled by the code for plants, where tautonymy is not allowed. If one transfers a species to another genus and this move creates a tautonym, one must find the next priorable name, or propose a new name. This is an example of binomial nomenclature not being stable.
It is allowed for the genus and species of a plant to mean the same, without being identical. For instance, Arctostaphylos uva-ursi is bearberry, in Greek and Latin respectively. There also are a few instances of modification of the genus name in the species, such as the fern Polypodium polypodioides, which means "a polypodium that is like a polypodium".
See also binomial nomenclature