Message11788

Author jeff.allen
Recipients jeff.allen, stefan.richthofer
Date 2018-03-12.23:24:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1520897042.54.0.467229070634.issue2546@psf.upfronthosting.co.za>
In-reply-to
Content
Stefan: I may be misunderstanding what you are expecting. Searching for an example, I find:

https://hg.python.org/jython/file/tip/src/org/python/modules/_io/PyFileIO.java#l63

It is true that my first attempts to have Jython produce that text were unsatisfactory:

>>> import io
>>> f = io.open('x.tmp', 'wb', buffering=0)
>>> type(f)
<type '_io.FileIO'>
>>> help(f.mode)
no Python documentation found for 'wb'

But it actually appears when you ask for help on the FileIO object:
>>> help(f)
Help on FileIO object:

class FileIO(_RawIOBase)
 |  Method resolution order:
 |      FileIO
 |      _RawIOBase
 |      _IOBase
 |      __builtin__.object
 |
 |  Methods defined here:
...
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  closefd
 |      True if the file descriptor will be closed
 |
 |  mode
 |      String giving the file mode: 'rb', 'rb+', or 'wb'
 |
...

This is similar in CPython.
History
Date User Action Args
2018-03-12 23:24:02jeff.allensetmessageid: <1520897042.54.0.467229070634.issue2546@psf.upfronthosting.co.za>
2018-03-12 23:24:02jeff.allensetrecipients: + jeff.allen, stefan.richthofer
2018-03-12 23:24:02jeff.allenlinkissue2546 messages
2018-03-12 23:24:01jeff.allencreate