Closed james77777778 closed 2 months ago
Hi @james77777778!
Thanks for catching this and thanks for sending the fix! I'm curious to understand why changing the order in the if/else fixes the issue. Also, do you know which docstring it's showing on the vscode? Is it Keras 2 docstring or Keras 3?
@SamanehSaadat
I'm curious to understand why changing the order in the if/else fixes the issue.
I'm not an expert on Pylance, but it seems to always choose the else
condition when it fails to recognize the condition.
Same observation applies to Keras library. For example, keras.ops.*
will always be directed to keras.src.backend.numpy.*
.
Also, do you know which docstring it's showing on the vscode? Is it Keras 2 docstring or Keras 3?
It will be Keras 3 since it is placed in else
condition.
This should fix the issue (after #1593) with type annotations for modern editors such as vscode.