Code Monkey home page Code Monkey logo

Comments (7)

jankatins avatar jankatins commented on June 27, 2024

This also looks wrong:

[ZMQTerminalIPythonApp] Loading IPython extension: storemagic

from jupyter_console.

takluyver avatar takluyver commented on June 27, 2024

It looks like it works with the execute_result message (that generates an Out prompt), but not with display_data:

In [1]: class A():
      :     def _repr_png_(self):
      :         return b'oijoij'
      :     

In [2]: a= A()

In [3]: a
Out[3]: <__main__.A at 0x7f052871f1d0>

In [4]: from IPython.display import display

In [5]: display(a)

from jupyter_console.

flying-sheep avatar flying-sheep commented on June 27, 2024

well I was against changing it πŸ˜‰

from jupyter_console.

flying-sheep avatar flying-sheep commented on June 27, 2024

well, the cause is easy to identify:

  1. handle_rich_data is called, which in turn calls handle_image and then returns True. when returning True, text/plain isn’t used.
  2. handle_image_PIL checks if the mimetype is PNG or SVG and returns if not, without doing anything.

we should make handle_image return True/False depending on if its delegated function can handle it the format.

AGAIN a bug exposed by having SVG! this is so useful!

from jupyter_console.

takluyver avatar takluyver commented on June 27, 2024

Thanks, well worked out. I've just opened #77 for it, and then noticed that you've done a fix as well. You've opened a PR against your own fork of the repo, though ;-)

from jupyter_console.

flying-sheep avatar flying-sheep commented on June 27, 2024

whoops

from jupyter_console.

jankatins avatar jankatins commented on June 27, 2024

AGAIN a bug exposed by having SVG! this is so useful!

More "(ab)using users as guinea pigs"... :-)

from jupyter_console.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.