Nick Coghlan wrote:
Brian Quinlan wrote:
- you need the cooperation of your subclasses i.e. they must call
  super().flush() in .flush() to get correct close behavior (and this
  represents a backwards-incompatible semantic change)

Are you sure about that? Going by the current _pyio semantics that
Antoine posted, it looks to me that it is already the case that
subclasses need to invoke the parent flush() call correctly to avoid
breaking the base class semantics (which really isn't an uncommon
problem when it comes to writing correct subclasses).

As it is now, if you didn't call super().flush() in your flush override, then a buffer won't be flushed at the time that you expected.

With the proposed change, if you don't call super().flush() in your flush override, then the buffer will never get flushed and you will lose data when you close the file.

I'm not saying that it is a big deal, but it is a difference.

Cheers,
Brian
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to