Skip to content

Commit

Permalink
Object base
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisrink10 committed Nov 26, 2024
1 parent 6e69642 commit d0c5980
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/basilisp/core.lpy
Original file line number Diff line number Diff line change
Expand Up @@ -6834,14 +6834,17 @@
(python/tuple (concat bases [basilisp.lang.interfaces/IProxy]))
(python/dict (merge methods base-methods)))))

;; TODO: support object as super
(defn get-proxy-class
"Given one or more base classes, return a proxy class for the given classes.
"Given zero or more base classes, return a proxy class for the given classes.
If no classes, Python's ``object`` will be used as the superclass.
Generated classes are cached, such that the same set of base classes will always
return the same resulting proxy class."
[& bases]
(let [base-set (set bases)]
(let [base-set (if (seq bases)
(set bases)
#{python/object})]
(-> (swap! proxy-cache (fn [cache]
(if (get cache base-set)
cache
Expand Down

0 comments on commit d0c5980

Please sign in to comment.