question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`experimental` decorator breaks class documentation.

See original GitHub issue

The experimental decorator used on classes break documentation. This could be one manifestation but there is an issue with how the documentation including type hints are propagated to the decorated class. This does not apply for free functions.

See https://github.com/optuna/optuna/pull/1265#issuecomment-633195955 for how it may break.

Expected behavior

Class documentation should not be altered by applying the experimental decorator.

Steps to reproduce

  1. Apply the experimental decorator to a class.
  2. Build the document (cd docs && make html)
  3. Open the rendered documentation and note that the class signatures is broken.

Additional context (optional)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
harupycommented, May 25, 2020

It looks fine. I’ll submit a PR.

Before:

Screen Shot 2020-05-25 at 20 11 42

After:

Screen Shot 2020-05-25 at 20 06 31
1reaction
harupycommented, May 25, 2020

Decorating wrapped_init by functools.wraps and removing func_spec_str should solve this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Breaking change to default useDefineForClassFields to true ...
This is a breaking change for any code with "experimentalDecorators": true , but I can't find documentation for it anywhere.
Read more >
Documentation - Decorators - TypeScript
Decorators are a stage 2 proposal for JavaScript and are available as an experimental feature of TypeScript. NOTE Decorators are an experimental feature ......
Read more >
Experimental decorators warning in TypeScript compilation
For me, this error "Experimental support for decorators is a feature that is subject to change in a future release. (etc)" only happened...
Read more >
How To Use Decorators in TypeScript - DigitalOcean
This tutorial will show you how create your own decorators in TypeScript for classes and class members, and also how to use them....
Read more >
Solving warning: “Experimental support for decorators is a ...
This article describes how to solve this warning that could be shown after use “decorators” in TypeScript. A “decorator” is a special kind...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found