[issue6567] Make inf be almost equal to inf
Lucas Prado Melo lucaspradom...@gmail.com added the comment: I would like to ask as a feature request that inf be almost equal to inf. I wrote a program with a timeline class that had a method to tell the time of the last event registered into it such that some events would be positioned at the infinite when they wouldn't occur. I did generic tests that would receive any output from this method and compare to the expected result through unittest.TestCase.assertAlmostEqual(). Notice, though, that I couldn't just pick assertEqual() to do this job because the time of the last event would be defined through a series of calculations. Despite that, I believe that everything which is equal to anything else would definitely be almost equal too. Thus, it would be nice to check for equality before checking for almost-equality to define whether two objects are almost equal. -- status: closed - open title: Isn't inf almost equal to inf? - Make inf be almost equal to inf type: behavior - feature request ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6567 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6567] Isn't inf almost equal to inf?
New submission from Lucas Prado Melo lucaspradom...@gmail.com: When we use TestCase.assertAlmostEqual to compare two float('inf') objects, the result is that float('inf') is not almost equal to float('inf'). I believe this is a bug. I tested against r74195 of Python 3.2 and against Python 2.6.2. -- messages: 90902 nosy: lucaspmelo severity: normal status: open title: Isn't inf almost equal to inf? versions: Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6567 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6567] Isn't inf almost equal to inf?
Changes by Lucas Prado Melo lucaspradom...@gmail.com: -- versions: +Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6567 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6567] Isn't inf almost equal to inf?
Changes by Lucas Prado Melo lucaspradom...@gmail.com: -- components: +Tests ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6567 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6567] Isn't inf almost equal to inf?
Changes by Lucas Prado Melo lucaspradom...@gmail.com: -- type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6567 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6467] raw_input() doesn't work as expected when it gets multiple ^D
New submission from Lucas Prado Melo lucaspradom...@gmail.com: -- $ cat raw_input_test.py s = '' try: while True: c = raw_input() print c s += c except EOFError: pass $ python raw_input_test.py test^D^Dtes ^D $ python --version Python 2.7a0 $ bash --version GNU bash, version 3.2.48(1)-release (i486-pc-linux-gnu) Copyright (C) 2007 Free Software Foundation, Inc. -- Surprisingly, though: -- $ python raw_input_test.py output test^D^D^D $ cat output test -- ^D = Press Ctrl+D I am using Ubuntu 9.04 (Jaunty Jackalope). -- components: IO messages: 90443 nosy: lucaspmelo severity: normal status: open title: raw_input() doesn't work as expected when it gets multiple ^D versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6467 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5870] subprocess.DEVNULL
Lucas Prado Melo lucaspradom...@gmail.com added the comment: -1 on this one. It is not a portable decision (only *nix OSes do have /dev/null). Also, why would we want it as a default constant? The subprocess module would need to open /dev/null every time. Despite that, I can't see how would someone use the redirection of errors to /dev/null through a python script and, at the same time, make it seem not a bad practice at all. -- nosy: +lucaspmelo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5870 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6447] PATCH: typo (English) in subprocess module
New submission from Lucas Prado Melo lucaspradom...@gmail.com: I am pretty sure this patch is alright. -- nosy: +lucaspmelo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6447 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Lucas Prado Melo lukepada...@gmail.com added the comment: I think this patch is ok. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5230 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6064] Add daemon argument to threading.Thread constructor
Lucas Prado Melo lukepada...@gmail.com added the comment: +1 to the py3k diff. :) Hey, I think this daemon property should be set as a keyword argument of the Thread constructor. -- nosy: +conf ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6064 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation
Lucas Prado Melo lukepada...@gmail.com added the comment: Ok A new patch without read1() changes. Only one test fails, a read1() test: == FAIL: test_read1 (test.test_io.PyBufferedRWPairTest) -- Traceback (most recent call last): File /home/lucas/Codes/python-stuff/py3k/Lib/test/test_io.py, line 1139, in test_read1 self.assertEqual(pair.read1(3), babc) AssertionError: b'a' != b'abc' Since I've changed peek_unlocked() (which is used once by read1()), I guess there's a problem with read1() expectations about it. -- Added file: http://bugs.python.org/file14305/peek4.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5811 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation
Lucas Prado Melo lukepada...@gmail.com added the comment: Here is a patch that passes all the tests (I had to change some of them though, they were expecting erroneous behaviours IMHO). The biggest problem was the read1 testing, I've tried to get the maximum of bytes less than or equal to what the user wanted while executing at most 1 raw_read()'s. I have created a new test for peek()'ing a number of bytes bigger than could possibly be stored on the buffer. -- Added file: http://bugs.python.org/file14304/peek3.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5811 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation
Lucas Prado Melo lukepada...@gmail.com added the comment: Here, it's a patch that passes all the tests (I had to change some of them though, they were expecting erroneous behaviours IMHO). The biggest problem was the read1 testing, I've tried to get the maximum of bytes less than or equal to what the user wanted while executing at most 1 raw_read()'s. I have created a new test for peek()'ing a number of bytes bigger than could possibly be stored on the buffer. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5811 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation
Lucas Prado Melo lukepada...@gmail.com added the comment: We could fill the buffer while moving its start point to 0. I guess this behavior would require a new function (or a new parameter to Modules/_io/bufferedio.c:_bufferedreader_fill_buffer() ). If you are ok with that I could write a patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5811 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation
Lucas Prado Melo lukepada...@gmail.com added the comment: Hey guys, I did a patch about this one. I didn't do many tests but I guess it is ok (it works like I think it should). What do you think? -- keywords: +patch nosy: +conf Added file: http://bugs.python.org/file14281/peek.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5811 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation
Lucas Prado Melo lukepada...@gmail.com added the comment: Oops I overlooked I minor flaw. A second version. -- Added file: http://bugs.python.org/file14282/peek2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5811 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5811] io.BufferedReader.peek(): Documentation differs from Implementation
Lucas Prado Melo lukepada...@gmail.com added the comment: There's a problem with my patch... When the size of the data we want to peek is too big ( buffer_len - start ) the cursor will move, thus there isn't a case where the peek function would work properly (except when we want to peek() just 1 byte). Couldn't we use a read() followed by a seek() instead? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5811 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Lucas Prado Melo lukepada...@gmail.com added the comment: I had lots of stuff to do lately, sorry it took me so long to answer. Here is the patch as we intended, but there is a bug yet. What if the non-existent imported module has the same name of the module itself? $ cat pydoc_badimport3.py import this_doesnt_exist.pydoc_badimport3 $ pydoc pydoc_badimport3 I tested this possibility, and I found out that there is a bug in this situation yet: pydoc still tells the user that the module couldn't be found. -- Added file: http://bugs.python.org/file14172/pydocs.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5230 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Changes by Lucas Prado Melo lukepada...@gmail.com: Removed file: http://bugs.python.org/file14140/pydocs.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5230 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Lucas Prado Melo lukepada...@gmail.com added the comment: Take a look at the output: $ python pydoc.py test.pydoc_badimport2 problem in test.pydoc_badimport2 - type 'exceptions.ImportError': No module named i_dont_exist.neither_do_i This is different from what you expected. How do we change this output? (I was talking about this issue in the last message) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5230 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Lucas Prado Melo lukepada...@gmail.com added the comment: Ok. New patch that passes the unit tests and with a new unit test covering inexistant nested modules. -- Added file: http://bugs.python.org/file14140/pydocs.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5230 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Changes by Lucas Prado Melo lukepada...@gmail.com: Removed file: http://bugs.python.org/file14138/pydocs.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5230 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Lucas Prado Melo lukepada...@gmail.com added the comment: by the way, I was not acquainted with this unit test thing... sorry -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5230 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Lucas Prado Melo lukepada...@gmail.com added the comment: I didn't understand what you mean: what should be shown when pydoc tries to generate documentation for a module with the bad import 'import test.i_dont_exist.neither_do_i'? I am not a native english speaker, so please excuse me if you don't understand something I've written or the other way around. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5230 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Lucas Prado Melo lukepada...@gmail.com added the comment: Thanks :) It seems that the error message carried by the ImportError object comes from Python/import.c:1504. What should we do: a) Edit Python/import.c b) Change the ImportError object c) Anything else. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5230 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Lucas Prado Melo lukepada...@gmail.com added the comment: I've written a patch. Hope you like it :) -- keywords: +patch nosy: +conf Added file: http://bugs.python.org/file14136/pydocs.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5230 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Lucas Prado Melo lukepada...@gmail.com added the comment: The same patch with whitespaces. Is it ok now? -- Added file: http://bugs.python.org/file14137/pydocs.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5230 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Changes by Lucas Prado Melo lukepada...@gmail.com: Removed file: http://bugs.python.org/file14136/pydocs.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5230 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Changes by Lucas Prado Melo lukepada...@gmail.com: Removed file: http://bugs.python.org/file14137/pydocs.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5230 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5230] pydoc reports misleading failure if target module raises an ImportError
Lucas Prado Melo lukepada...@gmail.com added the comment: A new patch with an unit test and with whitespaces. -- Added file: http://bugs.python.org/file14138/pydocs.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5230 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com