Re: Greater and less than operators [was Re: [Tutor] beginning to code]

2017-09-20 Thread Steve D'Aprano
On Thu, 21 Sep 2017 10:16 am, Rick Johnson wrote: >> You've never wanted to sort strings? How do you sort >> strings unless you have a concept of which string comes >> before the other, i.e. < operator? >> >> >>> 'xyz' < 'abc' >> False > > Interesting. But now we need to learn yet another set of

Re: Greater and less than operators [was Re: [Tutor] beginning to code]

2017-09-20 Thread Chris Angelico
On Thu, Sep 21, 2017 at 10:16 AM, Rick Johnson wrote: >> >>> 'xyz' < 'abc' >> False > > Interesting. But now we need to learn yet another set of > arbitrary rules. Consider this: > > >>> 'azzz' > 'zzz' > False > > Now, i'm not sure how Python decided that 'azzz' is not > greater than 'zzz'

Re: Greater and less than operators [was Re: [Tutor] beginning to code]

2017-09-20 Thread Rick Johnson
Steven D'Aprano wrote: > Rick Johnson wrote: > > > Of course, allowing all objects to use the `==`, `!=` > > sugars makes perfect sense, but `<`, `>`, `<=`, `>=` are > > meaningless outside of numeric-ish types. > > You've never wanted to sort strings? How do you sort > strings unless you have a

Greater and less than operators [was Re: [Tutor] beginning to code]

2017-09-19 Thread Steven D'Aprano
On Tue, 19 Sep 2017 17:26:55 -0700, Rick Johnson wrote: > Of course, allowing all objects to use the `==`, `!=` sugars makes > perfect sense, but `<`, `>`, `<=`, `>=` are meaningless outside of > numeric-ish types. You've never wanted to sort strings? How do you sort strings unless you have a c