Skip to content

Conversation

Carreau
Copy link
Member

@Carreau Carreau commented Jan 16, 2023

As far as I can tell setting this to Unicode does not achieve much. For example the IPython application that derives from it set it to a plain string and it works.

Same for description.

From my dev folder I haven't found any usage of name or description that needs this to be a Unicode, we we might as well make it always a str, which simplify a bit the codebase/types.

Usually the simpler the better.

It is technically backward incompatible.

See ipython/ipython#13895 that remove the usage of Unicode in description

As far as I can tell setting this to `Unicode` does not achieve much.
For example the IPython application that derives from it set it to a
plain string and it works.

Same for description.

From my dev folder I haven't found any usage of name or description that
needs this to be a `Unicode`, we we might as well make it always a str,
which simplify a bit the codebase/types.

Usually the simpler the better.

It is _technically_ backward incompatible.

See ipython/ipython#13895 that remove the usage
of Unicode in description
@rmorshea
Copy link
Contributor

Seems like a reasonable change, but wouldn't this also impact any assignment of name and description via the application's constructor, not just sub-classing?

Given that this is a breaking change, would this be included in a major release?

@Carreau
Copy link
Member Author

Carreau commented Jan 19, 2023

but wouldn't this also impact any assignment of name and description via the application's constructor

Hum, that's a good question.

Either it does not seem to do so, or there is not test for it.
Let me check it and maybe add tests.

No objection to have this wait for a major release if it's breaking.

@Carreau
Copy link
Member Author

Carreau commented Jan 19, 2023

You are right, if it is not set to = Unicode(), it can't indeed be modified via the constructor.

Now the main question is do we want name to be settable via the constructor for the default application. And a test need to be added.

Good catch.

Carreau added a commit to Carreau/traitlets that referenced this pull request Jan 20, 2023
Alternative to ipython#825, that adds tests for behavior.

I don't think we _need_ the ability to set the value via a constructor,
And I'm generally in favor of simplifying, but at least this should have
tests.
@Carreau
Copy link
Member Author

Carreau commented Jan 20, 2023

See #826, that adds a test, I'll change that to draft and we can discuss it for next major release.

@Carreau Carreau marked this pull request as draft January 20, 2023 09:20
blink1073 pushed a commit that referenced this pull request Jan 30, 2023
Alternative to #825, that adds tests for behavior.

I don't think we _need_ the ability to set the value via a constructor,
And I'm generally in favor of simplifying, but at least this should have
tests.
@Carreau Carreau closed this Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants