Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #33966
| Date | 2012-11-27 00:27 -0500 |
|---|---|
| From | Dave Angel <d@davea.name> |
| Subject | Re: Python dictionaries are awesome |
| References | <50b4262a$0$21875$c3e8da3$76491128@news.astraweb.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.310.1353994088.29569.python-list@python.org> (permalink) |
On 11/26/2012 09:32 PM, Steven D'Aprano wrote: > ... especially when you consider how some other languages implement them. > > > http://twistedoakgames.com/blog/?p=925 > > [quote] > Here’s the hypothetical situation: you’re making a flash game. In that > game users can create named profiles. You store the profiles, keyed by > their name, so that you ca- OOPS, you just introduced a bug. What’s the > problem? The dictionary. > [end quote] > > (facetious) Whenever someone tries to create a username that happens to conflict with a pre-existing attribute, just tell them that username is already taken. Just watch out when your user HasOwnProperty tries to delete his account. (/facetious) Namespaces are great, we should have lots of them. But be very careful about reusing one without checking to see if it's already inhabited. When a language design does this sort of thing, it tends to make us skittish about continuing use of said language. -- DaveA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Python dictionaries are awesome Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-27 02:32 +0000 Re: Python dictionaries are awesome Dave Angel <d@davea.name> - 2012-11-27 00:27 -0500 Re: Python dictionaries are awesome Chris Angelico <rosuav@gmail.com> - 2012-11-27 17:16 +1100
csiph-web