[issue46693] dataclass generated __str__ does not use overridden member __str__

2022-02-09 Thread Bruce Eckel
Bruce Eckel added the comment: Oops. That does in fact work. How do I remove the bug report? *Bruce Eckel* HappyPathProgramming.com SummerTechForum.com MindViewLLC.com Blog: BruceEckel.com EvolveWork.co WinterTechForum.com <http://www.WinterTechForum.com> OnJava8.com <http://www.On

[issue46693] dataclass generated __str__ does not use overridden member __str__

2022-02-09 Thread Bruce Eckel
New submission from Bruce Eckel : When creating a dataclass using members of other classes that have overridden their __str__ methods, the __str__ method synthesized by the dataclass ignores the overridden __str__ methods in its component members. Demonstrated in attached file

[issue27586] Is this a regular expression library bug?

2016-07-22 Thread Bruce Eckel
Bruce Eckel added the comment: Thank you ebarry, very helpful. Tim, sorry I missed you at Pycon. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue27586] Is this a regular expression library bug?

2016-07-21 Thread Bruce Eckel
Bruce Eckel added the comment: Urk. There was exactly a \g in the input. Sorry for the bother. -- resolution: -> not a bug ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.or

[issue27586] Is this a regular expression library bug?

2016-07-21 Thread Bruce Eckel
Bruce Eckel added the comment: Sorry, I thought maybe the error message would be indicative of something. Here's the re: find_output = re.compile(r"/\* (Output:.*)\*/", re.DOTALL) Here's the program: #! py -3 # Requires Python 3.5 # Updates generated output into extracted Jav

[issue27586] Is this a regular expression library bug?

2016-07-21 Thread Bruce Eckel
New submission from Bruce Eckel: This looks suspicious to me, like it could be a library bug, but before chasing it down I was hoping someone might be able to tell me whether I might be on to something: Traceback (most recent call last): File "update_extracted_example_output.py"

Inheriting from OrderedDict causes problem

2012-02-22 Thread Bruce Eckel
Notice that both classes are identical, except that one inherits from dict (and works) and the other inherits from OrderedDict and fails. Has anyone seen this before? Thanks. import collections class Y(dict): def __init__(self, stuff): for k, v in stuff: self[k] = v #

Re: Inheriting from OrderedDict causes problem

2012-02-22 Thread Bruce Eckel
On Feb 22, 10:10 am, Peter Otten __pete...@web.de wrote: Looks like invoking OrderedDict.__init__() is necessary: from collections import OrderedDict class X(OrderedDict): ...     def __init__(self, stuff): ...             super(X, self).__init__() ...             for k, v in stuff: ...

Python code file prototype

2012-02-17 Thread Bruce Eckel
I finally figured out how to set up the Windows explorer's right-click new so that it will create Python files. Here's how: http://superuser.com/questions/34704/windows-7-add-an-item-to-new-context-menu There's an option when you do this to insert default file contents, so I began searching the

Re: Python code file prototype

2012-02-17 Thread Bruce Eckel
        Of course, since the OP was talking Windows... the #! line is ignored no matter where it was G Yes, but I use Windows, Mac and Linux so I'm searching for something universal. -- http://mail.python.org/mailman/listinfo/python-list

Re: Automatic Type Conversion to String

2012-02-15 Thread Bruce Eckel
Could it be that you missed the fact that strings are immutable? That means that you can't change the content of the object once it is initialized. In particular, it means that you e.g. have to override __new__ instead of __init__, because the content is already fixed when the latter is

Automatic Type Conversion to String

2012-02-13 Thread Bruce Eckel
(): First draft tests are Windows-based import platform assert platform.system() == 'Windows' class test_paths(): def setUp(self): self.paths = [ (C:\\), (C:\\, Users, Bruce Eckel, Downloads, AtomicScala.zip), (C:\\, Users, Bruce Eckel, Dropbox

Re: Automatic Type Conversion to String

2012-02-13 Thread Bruce Eckel
I'm willing to subclass str, but when I tried it before it became a little confusing -- I think mostly because anytime I assigned to self it seemed like it converted the whole object to a str rather than a Path. I suspect I don't know the proper idiom for doing this -- any hints? Thanks ... --

Pycon disappointment

2008-03-16 Thread Bruce Eckel
If the following seems unnecessarily harsh, it was even more harsh for me to discover that the time and money I had spent to get to my favorite conference had been sold to vendors, presenting me as a captive audience they could pitch to. I believe that this year's Pycon organizers suffered from

Re: Pycon disappointment

2008-03-16 Thread Bruce Eckel
On Mar 16, 2:48 pm, Pete Forde [EMAIL PROTECTED] wrote: My friends and I decided to stage a grassroots Ruby conference this summer; it will have no paid sponsors for exactly this reason. We're trying to change up the typical format as well: it's a single-track event, no keynotes, no schills