Comments (5)
I don't know about that yet. But thanks for the idea.
from jedi.
This fails also. I wonder why this fails because the above first example works.
source = """\
import datetime
def f(obj):
if isinstance(obj, datetime.datetime):
obj."""
script = jedi.Script(source, 4, 12, '')
script.complete()
from jedi.
I fixed it for functions, but I won't add the functionality of your first example. This wouldn't be helpful, I think false positives are ok, but I don't think that this will help too much.
Clearly at the moment there are certain examples where this could work and it might help. But these are probably all examples where an experienced user could guess the type, looking at the code. So I really like to improve Jedi as an "experienced" user. And I still have enough ideas, just not enough time.
Another reason, why I reject your proposal is that I don't think that it fits into Jedi's architecture. All the stuff that involves Array handling is basically a hack and not as nice as the rest. The reason I don't like those hacks is pretty simple:
- They are hacks :-D
- They make Jedi extremely slow in certain situations (Which has to be controlled with certain checks to reduce slowness. If those checks stop the program, completion will not be successful). Basically the above behaviour would be really really bad for performance (in big files).
from jedi.
Thanks for the fix and answer. Rejecting my idea due to performance issue makes sense. It would be nice to be able to invoke Jedi optionally using my suggestion, to tell Jedi to "give me more candidates", though probably it complicate implementation. Knowing type of an object may be easy for experienced user but remembering attribute is hard. But anyway, it's just my opinion and I don't know the implementation difficulty :)
from jedi.
Yeah, I also think about such an option. But this is far away. Maybe we'll re-discuss it in a year :-)
from jedi.
Related Issues (20)
- Test failures with Python 3.12 HOT 4
- Drop support for running on legacy Python? HOT 1
- Tab complete for class __call__ not working HOT 1
- I would like to contribute as translator HOT 2
- allow users to set cache_directory via env-var HOT 9
- Jedi.names is not working HOT 3
- Missing docstring for pandas functions HOT 1
- Add support for `TypeAlias` HOT 4
- Addition of type annotation breaks tab completion in jedi>=0.19.0
- kwargs forwarding? HOT 1
- `LazyKnownValues` has no attribute `string_name`? HOT 4
- Enum name auto-completion without parentheses HOT 1
- Jedi searches the python interpreter in the wrong path. HOT 8
- Unhandled Exception with Unnamed Lambdas When Analyzing References Using dynaconf
- Add support for async pytest fixtures
- Is it possible to generate completion for `argparse.Namespace`? HOT 5
- TypedDict : Suggestion issues HOT 2
- Python stubs loaded from extensions folder even when using an explicit interpreter HOT 8
- Error when trying to detect environment HOT 5
- `PathFinder` has no attribute `find_module` in `python 12.2` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jedi.