← index #5570PR #29
Off-topic · high · value 0.448
QUERY · ISSUE

FileIO is not a subclass of IOBase

openby tveopened 2020-01-24updated 2021-09-26
py-core

E.g.:

>>> f = open("boot.py", 'rb')
>>> f
<io.FileIO 3ffe6480>
>>> import io
>>> isinstance(f, io.IOBase)
False

Needless to say, the result in CPython is True.

CANDIDATE · PULL REQUEST

BytesIO

closedby vitiralopened 2015-06-14updated 2015-06-18

add BytesIO object to the io module. Also pave the way for future buffered objects.

Note that I removed the first line in io.py that did something like from _io import *. I don't know what this was supposed to do.

Also I was thinking a description like "reduced stdlib io module from the micropython" would be appropriate with no long_description

1 comment
pfalcon · 2015-06-14

You must be kidding me, right? What word in the phrase:

You'd take your favorite Python project and would work towards making it run on uPy (not by preparing long patches - by discussing what's missing to make it run, and how to approach it!)

(specifically in the part in parentheses) perplexed you, so you went to do this? Don't you think that I wrote it not of love of preaching, but because it was very easy on my side to predict you doing just that? (Even though we spent few mails discussing just that issue in slightly different context!)

from _io import *. I don't know what this was supposed to do.

But don't you know from all your life experience that there're on 2 reliable ways to deal with such situation: 1) "don't touch it"; 2) get to learn and understand it. Funny thing that it's 2nd time in last 24hr I'm pointing that out wrt to uPy submissions (but the other guy went for choice 2 long before I made that comment).

Also, the phrase like above means that you don't even know Python, and despite it being very easily to learn, you don't even bother.

$ micropython 
>>> import _io
>>> dir(_io)
['__name__', 'open', 'FileIO', 'TextIOWrapper', 'StringIO', 'BytesIO']

This patch is a wasted effort and rejected.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied