Skip to content

JsMacros/JsMacros-Jython

Repository files navigation

JsMacros-Jython

This extension adds python 2.7 support to JsMacros 1.2.3+

issues/notes

  • use jython.py as the end of the file name if JEP is also installed to run using Jython instead of JEP.
  • jython doesn't auto-coerce functions to consumers, so use the extra library: consumer

1.0.2+

toConsumer(function) 1.0.2+

Example: consumer.toConsumer(func)

toBiConsumer(function) 1.0.2+

Example: consumer.toBiConsumer(func)

1.0.1

consumers aren't automatically created from py functions so use:

from java.util.function import Consumer

class jc(Consumer):
    def __init__(self, fn):
        self.accept=fn

same thing for BiConsumers basically.