[issue12005] modulo result of Decimal differs from float/int
New submission from Daniel Albeseder ko...@gmx.at: I know that the modulo operation for negative values is not well defined, but I would at least expect that the result is the same no matter if you use ints, floats or decimals. However Decimal seem to behave else than the builtin types. Python 3.1.2 (release31-maint, Sep 17 2010, 20:27:33) [GCC 4.4.5] on linux2 Type help, copyright, credits or license for more information. from decimal import Decimal -3 % 5 2 -3. % 5. 2.0 Decimal(-3) % Decimal (5) Decimal('-3') I could reproduce the same for python 2.6.6. -- components: Library (Lib) messages: 135176 nosy: Kotan priority: normal severity: normal status: open title: modulo result of Decimal differs from float/int type: behavior versions: Python 2.6, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12005 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9182] document “--” as a way to disti nguish option w/ narg='+' from positional argument in arg parse
Daniel Albeseder ko...@gmx.at added the comment: Steven: From msg121850 I think the last two examples do not need the --. Since there are no positional arguments, the -- is not needed. However the following additional cases exist: -x X [X ...] -y Y -- A B # since optionals might come in other order Basically every of the three variable length classes need to be tested: ZeroOrOne, ZeroOrMore and OneOrMore. This might always come in a conflict with positional arguments needed afterward (even with optional positional arguments!). BTW - I recognized the following seem to be supported: for [-x [X ...]] -- [y ...] the following input: a -x -- b I would expect to be 'a' and 'b' positional arguments and the optional '-x' has no argument. However this seem not to work. Another issue or desired behavior? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9182 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9182] document “--” as a way to disti nguish option w/ narg='+' from positional argument in arg parse
Daniel Albeseder ko...@gmx.at added the comment: Added more unit tests for testing the help text as well as the functionality of the -- separator. -- keywords: +patch Added file: http://bugs.python.org/file19731/issue9182.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9182 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9182] document “--” as a way to disti nguish option w/ narg='+' from positional argument in arg parse
Changes by Daniel Albeseder ko...@gmx.at: Removed file: http://bugs.python.org/file19731/issue9182.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9182 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9182] document “--” as a way to disti nguish option w/ narg='+' from positional argument in arg parse
Changes by Daniel Albeseder ko...@gmx.at: Added file: http://bugs.python.org/file19732/issue9182.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9182 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9182] document “--” as a way to disti nguish option w/ narg='+' from positional argument in arg parse
Daniel Albeseder ko...@gmx.at added the comment: Steven: The last part I guess would belong better in issue 9334. Using a -- to end all optionals is just a convention but -- could also be the argument to some option as well. We need to limit this in any way, and the way it is done right now seem very reasonable for me. Adding some additional unit tests testing this limits might be beneficial but I guess would be best done during issue 9334. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9182 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10469] test_socket fails
Daniel Albeseder ko...@gmx.at added the comment: current revision = svn revision 86553 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10469 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10453] Add -h/--help option to compileall
Daniel Albeseder ko...@gmx.at added the comment: I did a very simple addition to the CommandLineTest, to check that -h really returns the usage:. I am not sure, if this is useful since, it rather tests argparse now with the proposed patch... -- nosy: +Kotan Added file: http://bugs.python.org/file19685/test_compileall.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10453 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10453] Add -h/--help option to compileall
Daniel Albeseder ko...@gmx.at added the comment: I wanted to test, that no unwanted output is given before the usage. I just added the test before I started to try to fix this bug, as I recognized Michele already was already fixing the bug. This was just my test-driven approach, where the unit test failed before the fix, and should pass afterwards. As the unwanted output was the main reason for the issue, I just did put this into the test. However I agree that the test at all is silly, and I fully agree if it is not used. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10453 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10469] test_socket fails
Daniel Albeseder ko...@gmx.at added the comment: As this was requested on IRC, I put the Visual C++ 2010 Express solution and project files here as well. The patch pcbuild_vs2010.patch should be applied to the PCbuild directory. -- keywords: +patch Added file: http://bugs.python.org/file19686/pcbuild_vs2010.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10469 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9338] argparse optionals with nargs='+' can't be followed by positionals
Daniel Albeseder ko...@gmx.at added the comment: My attached patch adds the -- between the optionals and the arguments, if there are optionals which have variable length and at least some positional argument can be provided. Patch is for python 3.2 svn revision 86553. -- nosy: +Kotan Added file: http://bugs.python.org/file19691/issue9338_argparse.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9338 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9182] document “--” as a way to disti nguish option w/ narg='+' from positional argument in arg parse
Daniel Albeseder ko...@gmx.at added the comment: I did the patch for adding the -- in the generated usage text inside issue 9338. -- nosy: +Kotan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9182 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10469] test_socket fails
Daniel Albeseder ko...@gmx.at added the comment: #define EWOULDBLOCK 140 #define WSAEWOULDBLOCK 10035L The editor suggests that EWOULDBLOCK is already defined, therefore its code is used, i.e. 140. #define ECONNREFUSED107 #define WSAECONNREFUSED 10061L The E* are defined in errno.h and the WSA* in WinError.h. It seems that in my case the POSIX compliant headers are used. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10469 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10469] test_socket fails
Daniel Albeseder ko...@gmx.at added the comment: c:\Program Files\Microsoft Visual Studio 10.0\VC\include\errno.h The content of my errno.h: ... #define EILSEQ 42 #define STRUNCATE 80 #endif #endif /* Support EDEADLOCK for compatibility with older MS-C versions */ #define EDEADLOCK EDEADLK /* POSIX SUPPLEMENT */ #define EADDRINUSE 100 #define EADDRNOTAVAIL 101 ... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10469 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10469] test_socket fails
Daniel Albeseder ko...@gmx.at added the comment: Only in the system_error file. (http://msdn.microsoft.com/en-us/library/ee372194.aspx) Seem to be a C++0X standard header file. http://msdn.microsoft.com/en-us/library/5814770t.aspx talks about the Posix codes only for compatibility reasons. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10469 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10469] test_socket fails
Daniel Albeseder ko...@gmx.at added the comment: Ok I did switched the preference for all new defines inside VC++ errno.h to use the WSA* alternatives if available. Now test_socket passes for me, and the test_asyncore which did block before, now passes without a problem. -- Added file: http://bugs.python.org/file19713/issue10469.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10469 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10469] test_socket fails using Visual Studio 2010
Changes by Daniel Albeseder ko...@gmx.at: -- title: test_socket fails - test_socket fails using Visual Studio 2010 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10469 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com