conatraints on "for" magic?

Courageous jkraska1 at san.rr.com
Wed Jul 26 01:10:06 EDT 2000


 
> How did the implementer of the "fileinput" module convince the "for"
> construct that fileinput.input() was a sequence?

If you implemented an object that implemented all the methods
that a sequence implemented (or just the few that the for loop
object cared about), would python know the difference? NO.

Remember, Python has no real notion of types.



C/



More information about the Python-list mailing list