Jun-16-2020, 04:31 PM
(This post was last modified: Jun-16-2020, 04:32 PM by Gribouillis.)
I don't know if this is possible in general, but it looks like bad design. Friendly python functions that receive a file with a
write()
method will usually accept any file-like object and will never try to guess what's beyond the write method. I think if you need the information, give the responsibility to the caller and change the signature todef flood_with_spam(file, is_network): pass