Python Forum
testing for a network connection
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
testing for a network connection
#5
I understand that you want intelligent APIs but what I mean is that you are doing something unnatural when you're extracting information from a file object other than the information that can be obtained from the file object's documented attributes and methods. If the function wants to act differently depending on whether the file object is connected to the internet or not, it means that the file object is only an item of a more general context and the function should receive contextual elements in its arguments besides the pointer to file, or perhaps be a method of some class that provides these contextual elements. Alternately, the file object could be an instance of a specialized class containing thîs extra context.

May be it's just me.
Reply


Messages In This Thread
testing for a network connection - by Skaperen - Jun-16-2020, 01:02 AM
RE: testing for a network connection - by DeaD_EyE - Jun-16-2020, 05:12 PM
RE: testing for a network connection - by Skaperen - Jun-16-2020, 10:34 PM
RE: testing for a network connection - by Gribouillis - Jun-16-2020, 10:56 PM
RE: testing for a network connection - by DeaD_EyE - Jun-17-2020, 09:32 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020