Which coding style is better? public API or private method inside class definition

Paul Rubin no.email at nospam.invalid
Wed Jan 5 12:44:40 EST 2011


Inyeol <inyeol.lee at gmail.com> writes:
>         def get_all(self):
>             for number in self._numbers:
>                 yield number

I think

   def get_all(self):
      return iter(self._numbers)

is more direct.



More information about the Python-list mailing list