RFile; added property .closed to mirror standard `file` behaviour.

#649 Merged at cd5ae5a
Repository
pypy
Branch
default
Author
  1. Lishaak Bystroushaak
Reviewers
Description

I've added .closed property which allows you to check whether RFile instance is closed without the need to use _check_closed() which raises ValueError if the file is closed.

Comments (6)

  1. Ronan Lamy

    Hmm, properties are a bit broken in RPython, so I’m wondering if it’s a good idea to use them in rlib.

  2. Armin Rigo

    I think it's fine, because we don't expect inheritance troubles with simple classes like RFile. Agreed?

  3. Lishaak Bystroushaak author

    I’ve tested it with my interpreter and it seemed to work fine. What are the inheritance problems you mention?