Re: [Tutor] Function annotations

2017-02-05 Thread Steven D'Aprano
On Sat, Feb 04, 2017 at 10:11:39PM -0600, boB Stepp wrote: > Are the people making linters implementing checking function > annotations? Or is this something only gradually being adopted? Depends which linter :-) MyPy is still the reference implementation for type hinting in Python: http://myp

Re: [Tutor] sort() method and non-ASCII

2017-02-05 Thread Steven D'Aprano
On Sat, Feb 04, 2017 at 09:52:47PM -0600, boB Stepp wrote: > Does the list sort() method (and other sort methods in Python) just go > by the hex value assigned to each symbol to determine sort order in > whichever Unicode encoding chart is being implemented? Correct, except that there is only one

Re: [Tutor] sort() method and non-ASCII

2017-02-05 Thread Random832
On Sat, Feb 4, 2017, at 22:52, boB Stepp wrote: > Does the list sort() method (and other sort methods in Python) just go > by the hex value assigned to each symbol to determine sort order in > whichever Unicode encoding chart is being implemented? By default. You need key=locale.strxfrm to make it

Re: [Tutor] Syntax error while attempting to type in multiline statements in the interactive interpreter

2017-02-05 Thread Alan Gauld via Tutor
On 05/02/17 01:29, boB Stepp wrote: > But it seems to me on further thought that both REPL and what seems > most consistent to me, "...wait until all the input has been read, > then evaluate it all..." amounts to the same thing in the case of > entering function definitions into the interpreter.

Re: [Tutor] sort() method and non-ASCII

2017-02-05 Thread boB Stepp
On Sun, Feb 5, 2017 at 2:32 AM, Steven D'Aprano wrote: > On Sat, Feb 04, 2017 at 09:52:47PM -0600, boB Stepp wrote: >> Does the list sort() method (and other sort methods in Python) just go >> by the hex value assigned to each symbol to determine sort order in >> whichever Unicode encoding chart i

Re: [Tutor] sort() method and non-ASCII

2017-02-05 Thread boB Stepp
On Sat, Feb 4, 2017 at 10:50 PM, Random832 wrote: > On Sat, Feb 4, 2017, at 22:52, boB Stepp wrote: >> Does the list sort() method (and other sort methods in Python) just go >> by the hex value assigned to each symbol to determine sort order in >> whichever Unicode encoding chart is being implemen

Re: [Tutor] sort() method and non-ASCII

2017-02-05 Thread Cameron Simpson
On 05Feb2017 16:31, boB Stepp wrote: On Sat, Feb 4, 2017 at 10:50 PM, Random832 wrote: On Sat, Feb 4, 2017, at 22:52, boB Stepp wrote: Does the list sort() method (and other sort methods in Python) just go by the hex value assigned to each symbol to determine sort order in whichever Unicode e

Re: [Tutor] sort() method and non-ASCII

2017-02-05 Thread eryk sun
On Sun, Feb 5, 2017 at 10:30 PM, boB Stepp wrote: > I was looking at http://unicode.org/charts/ Because they called them > charts, so did I. I'm assuming that despite this organization into > charts, each and every character in each chart has its own unique > hexadecimal code to designate each c

Re: [Tutor] sort() method and non-ASCII

2017-02-05 Thread Steven D'Aprano
On Sun, Feb 05, 2017 at 04:31:43PM -0600, boB Stepp wrote: > On Sat, Feb 4, 2017 at 10:50 PM, Random832 wrote: > > On Sat, Feb 4, 2017, at 22:52, boB Stepp wrote: > >> Does the list sort() method (and other sort methods in Python) just go > >> by the hex value assigned to each symbol to determine

Re: [Tutor] sort() method and non-ASCII

2017-02-05 Thread boB Stepp
On Sun, Feb 5, 2017 at 5:25 PM, Cameron Simpson wrote: > You might want to drop this term "hexadecimal"; they're just ordinals (plain > old numbers). Though Unicode ordinals are often _written_ in hexadecimal for > compactness and because various character grouping are aligned on ranges > based o

Re: [Tutor] sort() method and non-ASCII

2017-02-05 Thread boB Stepp
On Sun, Feb 5, 2017 at 7:23 PM, Steven D'Aprano wrote: > On Sun, Feb 05, 2017 at 04:31:43PM -0600, boB Stepp wrote: >> On Sat, Feb 4, 2017 at 10:50 PM, Random832 wrote: >> > On Sat, Feb 4, 2017, at 22:52, boB Stepp wrote: > Alternatively, you can embed it right in the string. For code points >

Re: [Tutor] sort() method and non-ASCII

2017-02-05 Thread Cameron Simpson
On 05Feb2017 22:27, boB Stepp wrote: On Sun, Feb 5, 2017 at 7:23 PM, Steven D'Aprano wrote: Alternatively, you can embed it right in the string. For code points between U+ and U+, use the \u escape, and for the rest, use \U escapes: py> 'pi = \u03C0' # requires exactly four hex digit