GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — What is the possibility of having LambdaExpression and/or LambdaFunction able to be pickled? · Issue #22 · smarie/python-mini-lambda

What is the possibility of having LambdaExpression and/or LambdaFunction able to be pickled? #22

New issue
Copy link
New issue
Copy link
Open
Open
What is the possibility of having LambdaExpression and/or LambdaFunction able to be pickled?#22
Copy link

Description

@pfw
pfw
opened on May 9, 2021
Issue body actions

I have a use case for mini_lambda but need to be able to pickle the expression, I've had a quick look around and will do more but I thought I'd ask in case it is something you've considered before or had to rule out?

Activity

  1. pfw commented on May 9, 2021

    @pfw
    pfw
    on May 9, 2021
    Author
    More actions

    At the moment this is what I get:

    In [56]: pow2= x ** 2
    
    In [57]: pickle.dumps(pow2)
    ---------------------------------------------------------------------------
    RecursionError                            Traceback (most recent call last)
    <ipython-input-57-a89ed7061366> in <module>
    ----> 1 pickle.dumps(pow2)
    
    ~/thirdfloor/spatialgroup/pd/.direnv/python-3.6.13/lib/python3.6/site-packages/mini_lambda/main.py in __call__(self, *args, **kwargs)
        328                       + ', '.join([arg_name + '=' + get_repr(arg, None) for arg_name, arg in kwargs.items()]) + ')'
        329         return type(self)(fun=___call__, precedence_level=_PRECEDENCE_SUBSCRIPTION_SLICING_CALL_ATTRREF,
    --> 330                           str_expr=string_expr, root_var=root_var, repr_on=self.repr_on)
        331 
        332     # Special case for the string representation
    
    RecursionError: maximum recursion depth exceeded
    
  2. smarie commented on May 11, 2021

    @smarie
    smarie
    on May 11, 2021
    Owner
    More actions

    Hi @pfw thanks a lot for opening this issue !

    This was not in the scope of mini lambda at first so there are probably no tests for this, I am not surprised that it does not succeed. Would you like to dig a little and propose a pull request ? I'm afraid that I currently have no bandwidth to work on this issue myself, as these days my open source time goes to other libs.
    I can still of course provide integration and release of a working PR - although I'll probably have to update the template of this repo to my latest standards (such as in https://github.com/smarie/python-pyfields/ )

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.