[Python-Dev] Possible bug in class-init, lookin for mentors

Erik Bray erik.m.bray at gmail.com
Tue May 2 12:01:25 EDT 2017


On Fri, Apr 21, 2017 at 12:09 PM, Justus Schwabedal
<jschwabedal at gmail.com> wrote:
> Hi everyone,
>
> I possibly found a bug in class initialization and would like to fix it.
> Because it's my first journey to core-dev, I would really appreciate the
> help of a mentor that I may ask a few questions to get me up to speed.
>
> To my person, I have previously worked on larger projects in python, c, and
> c++ if that information helps, and I'm really curious to learn more about
> the interiors of the greatest interpreter known to wo-/men.
>
> Here comes the bug-producing example:
>
> `class Foo:
>     def __init__(self, bar=[]):
>         self.list = bar
>
> spam_1 = Foo()
> spam_2 = Foo()
>
> spam_1.list.append(42)
> print(spam_2.list)`
>
> At least I think it's a bug.  Maybe it's a feature..

Sorry to resurrect an old-ish thread; I haven't looked at Python-dev
in several weeks.  I just wanted to point out that while everyone on
this thread pointed out how this isn't a bug (clear to anyone who's
spent enough time with Python), we have here an experienced C/C++
developer who is interested in helping out on Python core devel, and
no one took him up on that offer.

Jus, for what it's worth, there are a slew of *actual* Python bugs to
be worked on--many languishing for years--due to lack of available
developer time.  You can have a good look at the (daunting) list of
bugs at the old bugs.python.org [1].  IIUC Python development is
slowly moving over to GitHub, but the issue list hasn't migrated yet
so that would still be the place to start.

If you find a bug that looks worth your time to try to fix, you should
probably follow up on the issue for that bug itself.  I can't make any
promises anyone will have time for mentorship, but I'd be willing to
point you in the right direction.  I'm not a core developer but I know
Python internals reasonably well and might be able to help *depending*
on the issue.

Best,
Erik

[1] http://bugs.python.org/


More information about the Python-Dev mailing list