alcemirfernandes / pynguin

Automatically exported from code.google.com/p/pynguin
GNU General Public License v3.0
0 stars 0 forks source link

An easy way to get a list of all the stored pynguins #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
People find it nice to be able to see what variables are pynguins and would 
like to do things like iterate over a list of them.

What version of the product are you using? On what operating system?
0.8/ubuntu9.10

Original issue reported on code.google.com by aresnick...@gmail.com on 29 Jun 2010 at 12:28

GoogleCodeExporter commented 9 years ago
Every new pynguin is pushed in to the pynguins list automatically:

>>> p
<pynguin.Pynguin object at 0x9bed02c>
>>> pynguin
<pynguin.Pynguin object at 0x9bed02c>
>>> pynguins
[<pynguin.Pynguin object at 0x9bed02c>]
>>> p2=Pynguin()
>>> pynguins
[<pynguin.Pynguin object at 0x9bed02c>, <pynguin.Pynguin object at 0x9d5dccc>]
>>> 

Or ...

>>> pyns = set(o for o in locals().values() if isinstance(o, Pynguin))

Original comment by miss...@hotmail.com on 29 Jun 2010 at 12:52

GoogleCodeExporter commented 9 years ago
Awesome; that's perfect--thanks!

Original comment by aresnick...@gmail.com on 29 Jun 2010 at 1:03

GoogleCodeExporter commented 9 years ago

Original comment by miss...@hotmail.com on 29 Jun 2010 at 2:52