Serhiy Storchaka added the comment:

I don't like PR 1385. abs_pos is a private attribute used only in 
_io._Buffered.seek() for readable streams when whence is SEEK_SET or SEEK_CUR. 
There is no guarantee that it contains relevant value for non-readable stream.

You could call buffer.seek(0, SEEK_CUR) rather than buffer.tell() for avoiding 
a system call for readable stream. But this looks as a shamanism too.

Or provide a function similar to the RAW_TELL macro but just checking if the 
current position is 0. If define it in bufferedio.c near _buffered_raw_tell() 
it is more chance that it is consistent with abs_pos and future changes don't 
break it.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30228>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to