Duplicates #6

Closed
opened 2024-09-20 16:25:59 +02:00 by Georg · 3 comments
Owner

love is duplicate in the map, the second one will never be returned.

`love` is duplicate in the map, the second one will never be returned.
Owner

How come it returned the second one when you tried it in this #7 (comment)

How come it returned the second one when you tried it in this https://git.com.de/LimnoriaPlugins/UnicodeEmoji/pulls/7#issuecomment-8719
Author
Owner

Good catch, I only assumed .get() would always return the first entry, however I missed the fact that Python silentry drops leading dictionary elements with the same name as later ones, so .get() behavior is not relevant here:

>>> mydict = {'foo': 'bar', 'foo': 'baz'}
>>> mydict
{'foo': 'baz'}
Good catch, I only assumed `.get()` would always return the first entry, however I missed the fact that Python silentry drops leading dictionary elements with the same name as later ones, so `.get()` behavior is not relevant here: ``` >>> mydict = {'foo': 'bar', 'foo': 'baz'} >>> mydict {'foo': 'baz'} ```
Author
Owner

#8

https://git.com.de/LimnoriaPlugins/UnicodeEmoji/pulls/8
Sign in to join this conversation.
No description provided.