Re: [Python-Dev] doctest and pickle

2013-06-08 Thread Steven D'Aprano
On 08/06/13 15:18, Stephen J. Turnbull wrote: Ethan Furman writes: Enumerations can be pickled and unpickled:: from enum import Enum class Fruit(Enum): ... tomato = 1 ... banana = 2 ... cherry = 3 ... from pickle

Re: [Python-Dev] doctest and pickle

2013-06-08 Thread Ethan Furman
On 06/07/2013 11:45 PM, Steven D'Aprano wrote: On 08/06/13 15:18, Stephen J. Turnbull wrote: Ethan Furman writes: Enumerations can be pickled and unpickled:: from enum import Enum class Fruit(Enum): ... tomato = 1 ... banana = 2 ...

[Python-Dev] Obsoleted RFCs

2013-06-08 Thread Serhiy Storchaka
Here is attached a list of obsoleted RFCs referred in the *.rst, *.txt, *.py, *.c and *.h files. I think it would be worthwhile to update the source code and documentation for more modern RFCs. For example for updating RFC3548 to RFC4648 there is an issue #16995. 821: Simple Mail Transfer

Re: [Python-Dev] doctest and pickle

2013-06-08 Thread Serhiy Storchaka
08.06.13 10:03, Ethan Furman написав(ла): Indeed, and it is already in several different ways. But it would be nice to have a pickle example in the docs that worked with doctest. I ended up doing what Barry did: from test.test_enum import Fruit from pickle import dumps, loads

Re: [Python-Dev] Obsoleted RFCs

2013-06-08 Thread Benjamin Peterson
2013/6/8 Serhiy Storchaka storch...@gmail.com: Here is attached a list of obsoleted RFCs referred in the *.rst, *.txt, *.py, *.c and *.h files. I think it would be worthwhile to update the source code and documentation for more modern RFCs. Just because you change the reference, doesn't mean

Re: [Python-Dev] Obsoleted RFCs

2013-06-08 Thread M.-A. Lemburg
On 08.06.2013 09:45, Serhiy Storchaka wrote: Here is attached a list of obsoleted RFCs referred in the *.rst, *.txt, *.py, *.c and *.h files. I think it would be worthwhile to update the source code and documentation for more modern RFCs. Thanks for creating such a list. BTW: What is

Re: [Python-Dev] Obsoleted RFCs

2013-06-08 Thread Serhiy Storchaka
08.06.13 11:23, Benjamin Peterson написав(ла): 2013/6/8 Serhiy Storchaka storch...@gmail.com: Here is attached a list of obsoleted RFCs referred in the *.rst, *.txt, *.py, *.c and *.h files. I think it would be worthwhile to update the source code and documentation for more modern RFCs. Just

Re: [Python-Dev] doctest and pickle

2013-06-08 Thread Ethan Furman
On 06/08/2013 01:07 AM, Serhiy Storchaka wrote: 08.06.13 10:03, Ethan Furman написав(ла): Indeed, and it is already in several different ways. But it would be nice to have a pickle example in the docs that worked with doctest. I ended up doing what Barry did: from test.test_enum import

Re: [Python-Dev] Obsoleted RFCs

2013-06-08 Thread Serhiy Storchaka
08.06.13 11:42, M.-A. Lemburg написав(ла): On 08.06.2013 09:45, Serhiy Storchaka wrote: Here is attached a list of obsoleted RFCs referred in the *.rst, *.txt, *.py, *.c and *.h files. I think it would be worthwhile to update the source code and documentation for more modern RFCs. Thanks

Re: [Python-Dev] Obsoleted RFCs

2013-06-08 Thread Serhiy Storchaka
By mistake some local files were added to the list. Here's an updated list. It now also contains low-case references. Attached also a script used to generate this list. 3: Documentation conventions. (Obsoleted by RFC0010) Lib/test/math_testcases.txt 10: Documentation conventions. (Obsoleted

Re: [Python-Dev] doctest and pickle

2013-06-08 Thread Serhiy Storchaka
08.06.13 11:47, Ethan Furman написав(ла): In this case it is better to exclude a code example from doctests or add auxiliary code (i.e. as Steven suggested) to pass the doctest. Are you saying there is something wrong about what I have in place now? I would think that one line showing

Re: [Python-Dev] Obsoleted RFCs

2013-06-08 Thread Stefan Drees
On 2013-06-08 10:59, Serhiy Storchaka wrote: 08.06.13 11:23, Benjamin Peterson ... : 2013/6/8 Serhiy Storchaka ... : Here is attached a list of obsoleted RFCs referred in the *.rst, *.txt, *.py, *.c and *.h files. I think it would be worthwhile to update the source code and documentation for

Re: [Python-Dev] Obsoleted RFCs

2013-06-08 Thread R. David Murray
On Sat, 08 Jun 2013 12:51:23 +0300, Serhiy Storchaka storch...@gmail.com wrote: 08.06.13 11:42, M.-A. Lemburg написав(ла): On 08.06.2013 09:45, Serhiy Storchaka wrote: Here is attached a list of obsoleted RFCs referred in the *.rst, *.txt, *.py, *.c and *.h files. I think it

Re: [Python-Dev] doctest and pickle

2013-06-08 Thread Ethan Furman
On 06/08/2013 03:09 AM, Serhiy Storchaka wrote: 08.06.13 11:47, Ethan Furman написав(ла): In this case it is better to exclude a code example from doctests or add auxiliary code (i.e. as Steven suggested) to pass the doctest. Are you saying there is something wrong about what I have in place

Re: [Python-Dev] Obsoleted RFCs

2013-06-08 Thread Stephen J. Turnbull
Serhiy Storchaka writes: 08.06.13 11:23, Benjamin Peterson написав(ла): 2013/6/8 Serhiy Storchaka storch...@gmail.com: Here is attached a list of obsoleted RFCs referred in the *.rst, *.txt, *.py, *.c and *.h files. I think it would be worthwhile to update the source code and

Re: [Python-Dev] doctest and pickle

2013-06-08 Thread Olemis Lang
On 6/8/13, Ethan Furman et...@stoneleaf.us wrote: On 06/08/2013 03:09 AM, Serhiy Storchaka wrote: 08.06.13 11:47, Ethan Furman написав(ла): [...] Fair point. But I suppose that if the end-user is running a doc test, it is not too much to require that the other tests be installed as well.

Re: [Python-Dev] doctest and pickle

2013-06-08 Thread Łukasz Rekucki
On 8 June 2013 17:41, Ethan Furman et...@stoneleaf.us wrote: On 06/08/2013 03:09 AM, Serhiy Storchaka wrote: Is it possible to add invisible code which doesn't displayed in the resulting documentation, but taken into account by doctest? I have no idea. This is my first time using doctest.

Re: [Python-Dev] doctest and pickle

2013-06-08 Thread R. David Murray
On Sat, 08 Jun 2013 19:54:18 +0200, =?UTF-8?Q?=C5=81ukasz_Rekucki?= lreku...@gmail.com wrote: On 8 June 2013 17:41, Ethan Furman et...@stoneleaf.us wrote: On 06/08/2013 03:09 AM, Serhiy Storchaka wrote: Is it possible to add invisible code which doesn't displayed in the resulting

[Python-Dev] Unicode minus sign in numeric conversions

2013-06-08 Thread Łukasz Langa
Expected behaviour: float('\N{MINUS SIGN}12.34') -12.34 Current behaviour: Traceback (most recent call last): ... ValueError: could not convert string to float: '−12.34' Please note: '\N{MINUS SIGN}' == '\u2212' -- Best regards, Łukasz Langa WWW: http://lukasz.langa.pl/ Twitter: @llanga

Re: [Python-Dev] Unicode minus sign in numeric conversions

2013-06-08 Thread Guido van Rossum
[Diverting to python-ideas, since this isn't as clear-cut as you think.] Why exactly is that expected behavior? What's the use case? (Surely you don't have a keyboard that generates \u2212 when you hit the minus key? :-) Is there a Unicode standard for parsing numbers? IIRC there are a variety

Re: [Python-Dev] Unicode minus sign in numeric conversions

2013-06-08 Thread MRAB
On 08/06/2013 23:30, Guido van Rossum wrote: [Diverting to python-ideas, since this isn't as clear-cut as you think.] Why exactly is that expected behavior? What's the use case? (Surely you don't have a keyboard that generates \u2212 when you hit the minus key? :-) Is there a Unicode standard

Re: [Python-Dev] Unicode minus sign in numeric conversions

2013-06-08 Thread R. David Murray
On Sun, 09 Jun 2013 01:39:59 +0100, MRAB pyt...@mrabarnett.plus.com wrote: On 08/06/2013 23:30, Guido van Rossum wrote: [Diverting to python-ideas, since this isn't as clear-cut as you think.] Why exactly is that expected behavior? What's the use case? (Surely you don't have a keyboard

Re: [Python-Dev] doctest and pickle

2013-06-08 Thread Nick Coghlan
On 9 June 2013 04:17, R. David Murray rdmur...@bitdance.com wrote: On Sat, 08 Jun 2013 19:54:18 +0200, =?UTF-8?Q?=C5=81ukasz_Rekucki?= lreku...@gmail.com wrote: On 8 June 2013 17:41, Ethan Furman et...@stoneleaf.us wrote: On 06/08/2013 03:09 AM, Serhiy Storchaka wrote: Is it possible to

Re: [Python-Dev] doctest and pickle

2013-06-08 Thread Ethan Furman
On 06/08/2013 09:21 PM, Nick Coghlan wrote: Using the test suite in the enum docstrings initially is fine. In the future, once we migrate a module like socket to using enum.IntEnum instead of bare integers, it would be appropriate to change the enum docs to reference that rather than the test