Any suggestion for improvement?

On Oct 25, 3:32 pm, Jonathan Lundell <jlund...@pobox.com> wrote:
> On Oct 25, 2011, at 1:18 PM, Anthony <abasta...@gmail.com> wrote:
>
> > On Tuesday, October 25, 2011 4:08:20 PM UTC-4, pepper_bg wrote:
> > > You can do
> > > s.get(6,None)
>
> > Still have to anticipate what my keys are and write different code
> > accordingly. Which is fine in most cases I guess. Or may be I am
> > trying to be too generic here. Thanks for your input...
>
> > If you're not sure whether a key might be a string or integer, you can use 
> > the s.get() method in all cases.
>
> Still, it'd make sense for s['a'] to have the same semantics as s.a.

Reply via email to