Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Primitive class with inspection #235

Open
SigmaX opened this issue Dec 22, 2022 · 1 comment
Open

Replace Primitive class with inspection #235

SigmaX opened this issue Dec 22, 2022 · 1 comment
Assignees
Labels
deferred_but_still_an_issue enhancement New feature or request good first issue Good for newcomers minor Something not critical that should be done at some point.

Comments

@SigmaX
Copy link
Collaborator

SigmaX commented Dec 22, 2022

In #234, we introduced an optional class hierarchy for genetic programming primitives to allow a small optimization. But all these classes do is allow the arity of primitives to be queried.

@markcoletti points out that we could us reflection via inspect to access this information instead—eliminating the need for the class rappers.

@SigmaX SigmaX added enhancement New feature or request good first issue Good for newcomers labels Dec 22, 2022
@SigmaX SigmaX added this to the Release 0.9 milestone Dec 22, 2022
@SigmaX SigmaX self-assigned this Dec 22, 2022
@lukepmccombs
Copy link
Collaborator

lukepmccombs commented Jul 5, 2023

I like the concept of this, although it would conflict with default arguments if they aren't considered as inputs to the function. From what I can find you can detect / extract default arguments fairly easily, but more exotic methods like curry or partial would probably still conflict. Maybe inspect as a default, but have a way to override the arity?

Edit for reference on detecting default parameters: https://stackoverflow.com/questions/12627118/get-a-function-arguments-default-value

@markcoletti markcoletti removed this from the Release 0.9 milestone Oct 12, 2023
@markcoletti markcoletti added minor Something not critical that should be done at some point. deferred_but_still_an_issue labels Oct 12, 2023
@github-project-automation github-project-automation bot moved this to Priority 3 in Siggy Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deferred_but_still_an_issue enhancement New feature or request good first issue Good for newcomers minor Something not critical that should be done at some point.
Projects
None yet
Development

No branches or pull requests

3 participants