Code Monkey home page Code Monkey logo

Comments (5)

davidhalter avatar davidhalter commented on July 20, 2024

I don't know about that yet. But thanks for the idea.

from jedi.

tkf avatar tkf commented on July 20, 2024

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.

davidhalter avatar davidhalter commented on July 20, 2024

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:

  1. They are hacks :-D
  2. 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.

tkf avatar tkf commented on July 20, 2024

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.

davidhalter avatar davidhalter commented on July 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.