Skip to content

Deprecate Public RunString #401

Closed
Closed

Description

@vmuriart

Deprecate Public API RunString to internal use and encourage use of RunSimpleString, Eval, Exec.
See #389 (comment) for related discussion.

Would use:

[Obsolete("Public use of RunString is deprecated, use Exec/Eval instead.")]
public static PyObject RunString(

Activity

  1. filmor commented on Feb 24, 2017

    @filmor
    Member

    Can't we remove it immediately? Didn't I introduce this for the setargv branch, at least in the extended form?

  2. vmuriart commented on Feb 24, 2017

    @vmuriart
    ContributorAuthor

    @filmor correct, you introduced the extended form in that pr. The previous form was there before though. I think we should give users atleast 1 release to migrate over if they are using it.

  3. filmor commented on Feb 24, 2017

    @filmor
    Member

    But we should only have the previous form public. I think we should hide all functions that operate on pointers directly (like this one does through use of locals and globals.

  4. yagweb commented on Feb 24, 2017

    @yagweb
    Contributor

    @vmuriart When implemented the methods Eval and Exec, I thought the better design is using PyDict instead of IntPtr? as the data type of their arguments globals and locals. However considering RunString may be widely used, keep using IntPtr? can simplify the code migration by directly replacing RunString with Exec. If the PyScope function in this PR is accomplished, people may prefer to use the Eval and Exec in it instead of this Eval and Exec.

    @denfromufa It seems like many people including me think the docs for embedding Python in .Net is too simple. Many sample code were added in the unit test project lately. Maybe I can help supplement this part of the docs after I have more practice.

  5. vmuriart commented on Feb 24, 2017

    @vmuriart
    ContributorAuthor

    @yagweb admitting, our docs are thin and outdated. We just migrated them from an old html file to an md file so that its easier to version control. We would definitely appreciate any help on this.

    @filmor good point. We can recreate the old public api and make the newer one internal. Looking back on 9912712 though we used to expose the IntPtr's api as well so won't be able to remove immediately either. @yagweb makes a good point that using PyDict makes more sense for this function signature too.

    I can open the pr if everyone agrees on the following.

    • Make current RunString method internal.
    • Add overload RunString with the old signatures, make public and deprecation notice for removal on a few releases

    In another pr (once we settle PyEngine, vs Py, vs ...)

    • Add some documentation to give visibility to newer methods.
  6. den-run-ai commented on Feb 27, 2017

    @den-run-ai
    Contributor

    @yagweb I agree that embedding docs are very thin. Which methods do you think need to be exposed in the API docs for embedding? I opened a separate issue for methods that need to added in docs: #410

  7. added this to the 2.3.0 milestone on Mar 3, 2017
  8. added 2 commits that reference this issue on Apr 7, 2017
    0b4c83b
    8e0b1a2
  9. added a commit that references this issue on Jun 1, 2017
    1aa6e4c
  10. added a commit that references this issue on Jun 9, 2017
    550a027
  11. added a commit that references this issue on Sep 22, 2017
    ed03682
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions