Skip to content

Fix: min-key lpy set ordering#857

Open
prairir wants to merge 1 commit intojank-lang:mainfrom
prairir:min-key-set
Open

Fix: min-key lpy set ordering#857
prairir wants to merge 1 commit intojank-lang:mainfrom
prairir:min-key-set

Conversation

@prairir
Copy link
Copy Markdown
Contributor

@prairir prairir commented Mar 19, 2026

Test that lpy ignores set values

@prairir
Copy link
Copy Markdown
Contributor Author

prairir commented Mar 19, 2026

Huh, oddly enough I cant reproduce the issue. This is what it fails with.


  File "/home/runner/work/clojure-test-suite/clojure-test-suite/.venv/lib/python3.13/site-packages/basilisp/core.lpy", line 2359, in get_in
    (defn get-in
    ...<15 lines>...
         m)))
  File "/home/runner/work/clojure-test-suite/clojure-test-suite/.venv/lib/python3.13/site-packages/basilisp/core.lpy", line 2371, in get_in__arity3
    (if-let [child-map (basilisp.lang.runtime/get m fk)]
      (get-in child-map rks default)
      default)
  File "/home/runner/work/clojure-test-suite/clojure-test-suite/.venv/lib/python3.13/site-packages/basilisp/core.lpy", line 2359, in get_in
    (defn get-in
    ...<15 lines>...
         m)))
  File "/home/runner/work/clojure-test-suite/clojure-test-suite/.venv/lib/python3.13/site-packages/basilisp/core.lpy", line 2374, in get_in__arity3
    (basilisp.lang.runtime/get m fk default)))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.12/x64/lib/python3.13/functools.py", line 934, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/home/runner/work/clojure-test-suite/clojure-test-suite/.venv/lib/python3.13/site-packages/basilisp/lang/runtime.py", line 1539, in _get_ilookup
    return m.val_at(k, default)
           ~~~~~~~~^^^^^^^^^^^^
  File "/home/runner/work/clojure-test-suite/clojure-test-suite/.venv/lib/python3.13/site-packages/basilisp/lang/map.py", line 313, in val_at
    return self._inner.get(k, default)
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/home/runner/work/clojure-test-suite/clojure-test-suite/.venv/lib/python3.13/site-packages/basilisp/lang/vector.py", line 125, in __eq__
    if hasattr(other, "__len__") and len(self) != len(other):
                                                  ~~~^^^^^^^
TypeError: object of type 'ABCMeta' has no len()

=========================== short test summary info ============================
FAILED test/clojure/core_test/ancestors.cljc::test-ancestors
================== 1 failed, 215 passed in 447.88s (0:07:27) ===================

@jeaye
Copy link
Copy Markdown
Member

jeaye commented Mar 21, 2026

Huh, oddly enough I cant reproduce the issue. This is what it fails with.


  File "/home/runner/work/clojure-test-suite/clojure-test-suite/.venv/lib/python3.13/site-packages/basilisp/core.lpy", line 2359, in get_in
    (defn get-in
    ...<15 lines>...
         m)))
  File "/home/runner/work/clojure-test-suite/clojure-test-suite/.venv/lib/python3.13/site-packages/basilisp/core.lpy", line 2371, in get_in__arity3
    (if-let [child-map (basilisp.lang.runtime/get m fk)]
      (get-in child-map rks default)
      default)
  File "/home/runner/work/clojure-test-suite/clojure-test-suite/.venv/lib/python3.13/site-packages/basilisp/core.lpy", line 2359, in get_in
    (defn get-in
    ...<15 lines>...
         m)))
  File "/home/runner/work/clojure-test-suite/clojure-test-suite/.venv/lib/python3.13/site-packages/basilisp/core.lpy", line 2374, in get_in__arity3
    (basilisp.lang.runtime/get m fk default)))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.13.12/x64/lib/python3.13/functools.py", line 934, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/home/runner/work/clojure-test-suite/clojure-test-suite/.venv/lib/python3.13/site-packages/basilisp/lang/runtime.py", line 1539, in _get_ilookup
    return m.val_at(k, default)
           ~~~~~~~~^^^^^^^^^^^^
  File "/home/runner/work/clojure-test-suite/clojure-test-suite/.venv/lib/python3.13/site-packages/basilisp/lang/map.py", line 313, in val_at
    return self._inner.get(k, default)
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/home/runner/work/clojure-test-suite/clojure-test-suite/.venv/lib/python3.13/site-packages/basilisp/lang/vector.py", line 125, in __eq__
    if hasattr(other, "__len__") and len(self) != len(other):
                                                  ~~~^^^^^^^
TypeError: object of type 'ABCMeta' has no len()

=========================== short test summary info ============================
FAILED test/clojure/core_test/ancestors.cljc::test-ancestors
================== 1 failed, 215 passed in 447.88s (0:07:27) ===================

Hm, I have no idea what's going on here. What's ABCMeta?

@chrisrink10
Copy link
Copy Markdown
Contributor

ABCMeta is the metaclass type used for Python's abstract base classes (closest parallel to interfaces in e.g. Java). Very strange that this is happening. Let me see if any changes were made recently to the ancestors test.

[1] identity [[2] [1] [3]]
;; set comparison returns first value
#{1} identity [#{1} #{2}]
#{2} identity [#{2} #{1} #{3}]]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not introduced by you but these tests don't fit the testing string, might be a good idea to just move these while you're here but don't want to give you extra work

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote the original tests so I'm happy to move them. Though I'm not certain what you mean 😅. Should I make a set testing section or rename the section?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that Emma was saying this doesn't quite fit under "testing multiple types", so a new section would be ideal. This is a nit, though, so not a blocker for this PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh understood. I should change the name to complex data types or something. Sorry I haven't gotten around to it. I've had a few family emergencies in the past week.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good, my dude. Thank you for all of the help and the responsiveness when it comes to reporting issues and fixing them. That's all we can hope for. I hope that everything's ok on your end. Take whatever time you need; there's no urgency with this.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes! Sorry for the late response but not a blocker and my point was what @jeaye said

@dgr
Copy link
Copy Markdown
Collaborator

dgr commented Apr 21, 2026

Do we think this is still an issue? It's been a month since the last comment and it seems like Basilisp is running tests cleanly on main branch at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants