[issue23397] PEP 431 implementation

2015-03-16 Thread Lennart Regebro
Lennart Regebro added the comment: FYI me and Berker started over here: https://bitbucket.org/regebro/cpython -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23397

[issue21634] Pystone uses floats

2014-06-02 Thread Lennart Regebro
New submission from Lennart Regebro: Pystone uses some floats in Python 3, while in Python 2 it's all integers. And since it is, as far as I can tell, based on Dhrystone, it should be all ints. After fixing the division in the loop to be a floor division it runs the same as in Python 2. I've

[issue21634] Pystone uses floats

2014-06-02 Thread Lennart Regebro
Lennart Regebro added the comment: Yes, good point, I added this in a new diff. -- Added file: http://bugs.python.org/file35443/pystone12.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21634

[issue21634] Pystone uses floats

2014-06-02 Thread Lennart Regebro
Lennart Regebro added the comment: Oups, yes, that's a typo. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21634 ___ ___ Python-bugs-list

[issue21634] Pystone uses floats

2014-06-02 Thread Lennart Regebro
Lennart Regebro added the comment: Awesome, thanks! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21634 ___ ___ Python-bugs-list mailing list

[issue17486] datetime.timezone returns the wrong tzname()

2013-03-19 Thread Lennart Regebro
New submission from Lennart Regebro: When calling tzname() on a timezone object it will return UTC + the offset. from datetime import timezone, timedelta, datetime tz = timezone(timedelta(hours=3)) dt = datetime(2013, 3, 14, 12, 30, tzinfo=tz) dt.tzname() 'UTC+03:00' But this breaks

[issue17393] stdlib import mistaken for local by import_fixer

2013-03-11 Thread Lennart Regebro
Lennart Regebro added the comment: Not really, but they are related. The fixer looks for a local module, and if it finds it it will assume the import is local. #13317 is caused by it not finding the module, since it's not built and hence assuming it's a global import. This bug, contrariwise

[issue17393] stdlib import mistaken for local by import_fixer

2013-03-10 Thread Lennart Regebro
New submission from Lennart Regebro: If you have a local folder (without an __init__.py, hence just a normal folder) with the same name as a non local module, the import statements of that module will assumed to be local and transformed from for example ``import datetime`` to ``from . import

[issue17393] stdlib import mistaken for local by import_fixer

2013-03-10 Thread Lennart Regebro
Changes by Lennart Regebro rege...@gmail.com: -- type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17393 ___ ___ Python-bugs-list

[issue15760] make install should generate grammar file

2012-08-22 Thread Lennart Regebro
New submission from Lennart Regebro: If you install Python 3.3b2 with sudo make install, a standard way of installing it so that users don't have rights to install global modules, then everytime lib2to3.pgen2.driver.load_grammar() is called, it aims to generate a a grammar table and write

[issue15760] make install should generate grammar file

2012-08-22 Thread Lennart Regebro
Changes by Lennart Regebro rege...@gmail.com: -- components: +Installation ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15760 ___ ___ Python-bugs

[issue15760] make install should generate grammar file

2012-08-22 Thread Lennart Regebro
Lennart Regebro added the comment: Yes, and for some reason it didn't show up when I searched for Grammar 10 minutes ago, but now it does. :-) It's a duplicate, indeed. -- status: open - closed ___ Python tracker rep...@bugs.python.org http

[issue15645] 2to3 Grammar pickles not created when upgrading to 3.3.0b2

2012-08-22 Thread Lennart Regebro
Lennart Regebro added the comment: I can confirm that this is an issue on Ubuntu 12.04 as well, and that removing the existing pre 3.3b2 install before installing solves the problem. -- nosy: +lregebro ___ Python tracker rep...@bugs.python.org http

[issue12932] dircmp does not allow non-shallow comparisons

2012-05-17 Thread Lennart Regebro
Lennart Regebro rege...@gmail.com added the comment: filecmp is still there in Python 3.3 Alpha 3. I can't find any reference to it being deprecated. -- nosy: +lregebro ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12932

[issue12896] Recommended location of the interpreter for Python 3

2011-09-04 Thread Lennart Regebro
New submission from Lennart Regebro rege...@gmail.com: The documentation on Using Python, 2.3. Python-related paths and files says that exec_prefix/bin/python is the recommended location for the interpreter, while for Python 3 it's exec_prefix/bin/python3. http://docs.python.org/py3k/using

[issue10042] total_ordering

2011-04-20 Thread Lennart Regebro
Lennart Regebro rege...@gmail.com added the comment: I was also surprised by the special return value, but it seems a bit overkill to change the implementation of rich comparison operators just because it's tricky to make a short and pretty class decorator that extends some operators to all

[issue10042] total_ordering

2011-04-19 Thread Lennart Regebro
Lennart Regebro rege...@gmail.com added the comment: We *do* care about NotImplemented, that's the whole point of this bug report. I don't see how this is a problem in the new_total_ordering.py example. Can you give an example of when you get a stack overflow? The examples

[issue10042] total_ordering

2011-04-19 Thread Lennart Regebro
Lennart Regebro rege...@gmail.com added the comment: I'm attaching a file with the example classes returning NotImplemented, and a different implementation of a total ordering, as an example of how returning NotImplemented by one class will give the chance to the other class

[issue10042] total_ordering

2011-04-19 Thread Lennart Regebro
Lennart Regebro rege...@gmail.com added the comment: Ah! I see how you mean. The problem isn't just if you turn the conversion around from self other to other self. The problem in fact appears when a rich text function uses the != operators on self directly. I tried a version which uses

[issue10042] total_ordering

2011-04-19 Thread Lennart Regebro
Lennart Regebro rege...@gmail.com added the comment: Yeah, I can't say it's pretty though. :) Anyway this is an issue for 3.2 and 2.7 as well, then, so I add them back. -- versions: +Python 2.7, Python 3.2 ___ Python tracker rep...@bugs.python.org

[issue10954] No warning for csv.writer API change

2011-01-22 Thread Lennart Regebro
Lennart Regebro rege...@gmail.com added the comment: In the worst case, not checking for newline='' is not a big problem, as anyone moving from Python 2 to Python 3 will open the file in binary mode. That error message could tell the user to use binary mode newlines=''. Using textmode

[issue10042] total_ordering stack overflow

2011-01-21 Thread Lennart Regebro
Lennart Regebro rege...@gmail.com added the comment: This also affects Python 2.7, where it hasn't been fixed. Maybe reopen it? -- nosy: +lregebro ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10042

[issue10954] No warning for csv.writer API change

2011-01-20 Thread Lennart Regebro
New submission from Lennart Regebro rege...@gmail.com: In Python 2 the file used for csv.writer() should be opened in binary mode, while in Python 3 is should be opened in text mode but with newlines set to ''. This change is neither warned for by python -3, nor is there a fixer

[issue10954] No warning for csv.writer API change

2011-01-20 Thread Lennart Regebro
Changes by Lennart Regebro rege...@gmail.com: -- nosy: +sjmachin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10954 ___ ___ Python-bugs-list

[issue9124] Mailbox module demonstrates infeasibly slow performance

2011-01-12 Thread Lennart Regebro
Lennart Regebro rege...@gmail.com added the comment: I can confirm on Ubuntu and with other example mailboxes. Looping through the messages and printing the subjects takes around 200-300 times longer under Python 3 than under Python 2. -- nosy: +lregebro

[issue9124] Mailbox module demonstrates infeasibly slow performance

2011-01-12 Thread Lennart Regebro
Lennart Regebro rege...@gmail.com added the comment: 3.2 sees a small improvement when running the Steve test: Python 2.6.6: 0.0291s Python 3.1.2: 31.1s Python 3.2b2+: 28.8s This is Ubuntu 10.04 on ext3, with all Pythons compiled from source, with no configure attributes except a prefix. I

[issue8471] Unicode returns in doctest can make subsequent tests fail

2010-04-20 Thread Lennart Regebro
New submission from Lennart Regebro rege...@gmail.com: If we return unicode, SpoofOut's buf variable becomes automagically converted to unicode. This means all subsequent output becomes converted to unicode, and if the output contains non-ascii characters that fails. That means

[issue8473] doctest fails if you have inconsistent lineendings

2010-04-20 Thread Lennart Regebro
New submission from Lennart Regebro rege...@gmail.com: If the doctest file has both Windows and unix lineendings you get an error. Yeah, I know, it's not a serious bug, but it's also easy to fix. Attached patch with test. Seems to not be an issue on Python 3. -- components: Extension

[issue7490] IGNORE_EXCEPTION_DETAIL should ignore the module name

2010-04-15 Thread Lennart Regebro
Lennart Regebro rege...@gmail.com added the comment: The ellipsis doesn't work, because when you have an ellipsis at the beginning of the message, doctest will not understand that it's supposed to be an Exception, so it doesn't even try to match exceptions, and it will therefore always fail

[issue7490] IGNORE_EXCEPTION_DETAIL should ignore the module name

2010-04-15 Thread Lennart Regebro
Lennart Regebro rege...@gmail.com added the comment: Sure: Catch the exception in the test, and fail if it isn't catched. try: ... do_something_that_raises_exception() ... raise Assertionerror(Exception Blah was not raised) ... except Blah: ... pass Ugly, yes, but easy. To make

[issue7490] IGNORE_EXCEPTION_DETAIL should ignore the module name

2010-04-15 Thread Lennart Regebro
Lennart Regebro rege...@gmail.com added the comment: It's not possible for 2to3 to reformat exceptions, as the formatting would need to go from TheException to themodule.TheException, and there is no way to figure out the module name

[issue7490] IGNORE_EXCEPTION_DETAIL should ignore the module name

2010-04-15 Thread Lennart Regebro
Lennart Regebro rege...@gmail.com added the comment: Sure, but +IGNORE_EXCEPTION_DETAIL will only work on Python 3.2+, so 2to3 can't solve the issue. It can only help once 3.2 does the actual solving. ;) 3to2 could simply remove the module name from exceptions in the output. You don't need

[issue7490] IGNORE_EXCEPTION_DETAIL should ignore the module name

2010-01-22 Thread Lennart Regebro
Changes by Lennart Regebro rege...@gmail.com: Removed file: http://bugs.python.org/file15537/python-py3k-exception-detail.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7490

[issue7490] IGNORE_EXCEPTION_DETAIL should ignore the module name

2010-01-22 Thread Lennart Regebro
Changes by Lennart Regebro rege...@gmail.com: Removed file: http://bugs.python.org/file15538/python-trunk-exception-detail.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7490

[issue7490] IGNORE_EXCEPTION_DETAIL should ignore the module name

2010-01-22 Thread Lennart Regebro
Lennart Regebro rege...@gmail.com added the comment: New diff for trunk, with the additional test -- Added file: http://bugs.python.org/file15972/python-trunk-exception-detail.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue7490] IGNORE_EXCEPTION_DETAIL should ignore the module name

2010-01-22 Thread Lennart Regebro
Lennart Regebro rege...@gmail.com added the comment: New diff for Py3k with the additional test -- Added file: http://bugs.python.org/file15973/python-py3k-exception-detail.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue7490] IGNORE_EXCEPTION_DETAIL should ignore the module name

2009-12-13 Thread Lennart Regebro
New submission from Lennart Regebro rege...@gmail.com: In Python 3.x [1] the exception formatting prints the module path, while under 2.x it prints only the exception class name. This makes it very tricky to make doctests that pass under both Python 2 and Python 3 without resorting to ugly

[issue7490] IGNORE_EXCEPTION_DETAIL should ignore the module name

2009-12-13 Thread Lennart Regebro
Changes by Lennart Regebro rege...@gmail.com: Added file: http://bugs.python.org/file15538/python-trunk-exception-detail.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7490

[issue7490] IGNORE_EXCEPTION_DETAIL should ignore the module name

2009-12-13 Thread Lennart Regebro
Lennart Regebro rege...@gmail.com added the comment: Yes, x.y.Exception and a.b.Exception should match. I just realized I didn't add an explicit test for that, but maybe that's not strictly necessary. -- ___ Python tracker rep...@bugs.python.org http

[issue5616] Distutils 2to3 support doesn't have the doctest_only flag.

2009-03-31 Thread Lennart Regebro
Lennart Regebro rege...@gmail.com added the comment: Also, the run_2to3 method takes the explicit parameter, but does not pass it into the DistutilsRefactoringTool. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5616

[issue5616] Distutils 2to3 support doesn't have the doctest_only flag.

2009-03-30 Thread Lennart Regebro
New submission from Lennart Regebro rege...@gmail.com: The run_2to3 method, and therefore also the Mixin2to3 class doesn't take a parameter for doctest_only parameter that refactor has. That means you have to do a lot of code duplication if you want to write distutil commands that handle doctest

[issue4664] import urlparse, cStringIO breaks

2008-12-14 Thread Lennart Regebro
New submission from Lennart Regebro rege...@gmail.com: If you have urlparse before cStringIO in an import line, 2to3 will not convert the cStringIO to io. However, reverse the order, and urlparse will not get translated. So this file: import urlparse, cStringIO import cStringIO, urlparse

[issue4664] fix_imports does not refactor import urlparse, cStringIO correctly

2008-12-14 Thread Lennart Regebro
Lennart Regebro rege...@gmail.com added the comment: Heres my test file. Added file: http://bugs.python.org/file12357/test3.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4664

[issue4664] fix_imports does not refactor import urlparse, cStringIO correctly

2008-12-14 Thread Lennart Regebro
Lennart Regebro rege...@gmail.com added the comment: What version are you running? Can you post the output? ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4664

[issue4559] Whats new recommendation error

2008-12-06 Thread Lennart Regebro
New submission from Lennart Regebro [EMAIL PROTECTED]: The whatsnew/3.0.rst document claims It is not recommended to try to write source code that runs unchanged under both Python 2.6 and 3.0; you’d have to use a very contorted coding style, e.g. avoiding print statements, metaclasses, and much

[issue4559] Whats new recommendation error

2008-12-06 Thread Lennart Regebro
Lennart Regebro [EMAIL PROTECTED] added the comment: That is not true, and statement as it stands now is still factually incorrect. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4559

[issue4559] Whats new recommendation error

2008-12-06 Thread Lennart Regebro
Lennart Regebro [EMAIL PROTECTED] added the comment: A future import is not much of a contortion, and metaclasses is not exactly an everyday occurrence, after 9 years of python I have yet to write a metaclass... Of course I don't like that it specifically mentiones 2.6, while 2.6 has lot's

[issue4559] Whats new recommendation error

2008-12-06 Thread Lennart Regebro
Lennart Regebro [EMAIL PROTECTED] added the comment: I've never said that is the goal. You are misrepresenting or misinterpreting my standpoint. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4559

[issue4559] Whats new recommendation error

2008-12-06 Thread Lennart Regebro
Lennart Regebro [EMAIL PROTECTED] added the comment: Well, that *is* the intention of a from __future__ import, isn't it? That doesn't mean that's the intention of 2.6 as a whole, just that statement. ___ Python tracker [EMAIL PROTECTED] http

[issue4559] Whats new recommendation error

2008-12-06 Thread Lennart Regebro
Lennart Regebro [EMAIL PROTECTED] added the comment: Fair enough, but I still think we can come up with a better example that requires more contortions than print, which doesn't. I think a good example of contortions is binary file data, which has two different types in 2.6 and 3.0. Also