← All challenges
easysympy/sympy · v1.7

Symbol instances have __dict__ since 1.7?

Try this bug with AI

Fix it in the original repo with an AI agent and get feedback on how you worked.

2 free rounds each week

Round mode
  • Time limit60 min
  • Token budgetup to 1M
  • Worth up to135 XP
Sign up or sign in to start

Read the sample report

From a simulated Django round

You changed code before reproducing the bug.

Run the failing test before the first edit, so you know the failure you are fixing and can tell when it is gone.

Problem statement

In version 1.6.2 Symbol instances had no __dict__ attribute

python
>>> sympy.Symbol('s').__dict__
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-3-e2060d5eec73> in <module>
----> 1 sympy.Symbol('s').__dict__

AttributeError: 'Symbol' object has no attribute '__dict__'
>>> sympy.Symbol('s').__slots__
('name',)

This changes in 1.7 where sympy.Symbol('s').__dict__ now exists (and returns an empty dict)
I may misinterpret this, but given the purpose of __slots__, I assume this is a bug, introduced because some parent class accidentally stopped defining __slots__.

The environment starts at commit cffd4e0f86fe (sympy/sympy 1.7), dependencies installed and tests runnable from the first minute. You are graded by hidden tests taken from the fix that was actually merged upstream.