Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems pop out when changing __repr__ in a class inherent str class #6087

Closed
plinypan opened this issue Dec 29, 2017 · 1 comment
Closed

Comments

@plinypan
Copy link

Description

What steps will reproduce the problem?

  1. Create a class with parent str
  2. Define __repr or str in the class otherwise
  3. Create an instance of this new class and try to print it

What is the expected output? What do you see instead?
Return of the newly defined repr should be printed instead

Please provide any additional information below
I was using Anaconda3.6
File "D:\Coding\lib\site-packages\qtconsole\base_frontend_mixin.py", line 163, in _dispatch
handler(msg)
File "D:\Coding\lib\site-packages\spyder\widgets\ipythonconsole\namespacebrowser.py", line 220, in _handle_execute_reply
self.handle_exec_method(msg)
File "D:\Coding\lib\site-packages\spyder\widgets\ipythonconsole\shell.py", line 354, in handle_exec_method
view = ast.literal_eval(literal)
File "D:\Coding\lib\ast.py", line 48, in literal_eval
node_or_string = parse(node_or_string, mode='eval')
File "D:\Coding\lib\ast.py", line 35, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
File "", line 1
{'a': {'type': 'tp', 'size': 1, 'color': '#800000', 'view': tp:2016}}
^
SyntaxError: invalid syntax

Version and main components

  • Spyder Version: 3.2.4
  • Python Version: 3.6.3
  • Qt Versions: 5.6.2, PyQt5 5.6 on Windows

Dependencies

pyflakes >=0.6.0 :  1.6.0 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pygments >=2.0   :
@ccordoba12
Copy link
Member

Thanks for reporting. This is a duplicate of issue #5636 and it'll be fixed in our next release (3.2.6).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants