python mdelitem snippet fix