Skip to content

Instantly share code, notes, and snippets.

@taddeimania
Last active August 29, 2015 14:16
Show Gist options
  • Save taddeimania/736938e8f0ceee8a2f8d to your computer and use it in GitHub Desktop.
Save taddeimania/736938e8f0ceee8a2f8d to your computer and use it in GitHub Desktop.
Accessing magic methods in Hy
(defclass Person []
[[name "joel"]])
(setv me (Person))
(print me.__class__)
(print "primitive".__class__)
;;from hy.core.language import name
;; class Person:
;; name = u'joel'
;; me = Person()
;; print(me.__class__)
;; print(u'primitive', .__class__)
;; REVISED!====================================
(print (. "primitive" __class__))
;; PRODUCES
;; print(u'primitive'.__class__)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment