AnonymouX47 / term-image

Display images in the terminal with python
https://term-image.readthedocs.io
MIT License
206 stars 9 forks source link

Redesign Render Arguments & Data Namespace APIs #101

Closed AnonymouX47 closed 9 months ago

AnonymouX47 commented 9 months ago

Required for the advancement of #100.

From a dynamic typing perspective, both the current and new APIs are equally good but the current will not work with static typing.

The new API happens to have a couple minor downsides though:

  1. If a RenderArgs(render_cls) is created before an argument namespace class is associated with render_cls, that RenderArgs instance will lack a namespace for render_cls, unlike those created afterwards.
  2. If render_cls is subclassed before an argument namespace class is associated with render_cls, every RenderArgs instance associated with that subclass will lack a namespace for render_cls.

The same applies to render data... but looking on the bright side, this typically shouldn't occur and there's an admonition in the docs concerning this.