Giter Site home page Giter Site logo

Customizer rework about jpype HOT 2 CLOSED

thrameos avatar thrameos commented on June 21, 2024
Customizer rework

from jpype.

Comments (2)

Thrameos avatar Thrameos commented on June 21, 2024

Plan of attack for this is to use decorators so that the system is entirely automated rather than a customizer class.

from jpype import SuperFor, ImplementationFor, JClass

#Insert JString into the class tree as a base class of java.lang.String
@SuperFor("java.lang.String")
class JString(JObject):  # we must derive from JObject so that we will appear before it in the mro.
   # This method will appear in the class tree
   def doSomething(self):
      pass

# All methods from this class will be copied into java.lang.Object when that class is created.
@ImplementationFor("java.lang.Object")
class MyObjectMethods(object):
   # This method will appear in java.lang.Object class.  It can either be a static method 
   # which will take either the class or the object as self or a method which will expect
   # self to be an object.
   def doSomething(self):
      pass

To be resolved.

  • Will this work with the new style of decorator that is planned for python?
  • How to determine if it was called as a static method? Should be as easy as if isinstance(self, JClass): called static

from jpype.

Thrameos avatar Thrameos commented on June 21, 2024

Completed in 0.7

from jpype.

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.