Advertisement
Guest User

Untitled

a guest
Dec 14th, 2023
442
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. ===== root/one.py =====
  2.  
  3. from root import two
  4.  
  5. class One:
  6.  
  7.     def thing(self):
  8.         print(two.Two())
  9.  
  10. ===== root/two.py =====
  11.  
  12. from root import one
  13.  
  14. class Two:
  15.  
  16.     def thing(self):
  17.         print(one.One())
  18.  
  19. ===== root/__init__.py =====
  20.  
  21.  
  22. ===== REPL session =====
  23.  
  24. $ python3
  25. Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux
  26. Type "help", "copyright", "credits" or "license" for more information.
  27. >>> from root import one
  28. >>> one.One().thing()
  29. <root.two.Two object at 0x7f284b0aead0>
  30. >>> from root import two
  31. >>> two.Two().thing()
  32. <root.one.One object at 0x7f284b0aea10>
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement