Skip to content

Document the restrictions #267

@vanillajonathan

Description

@vanillajonathan

I read the documentation and vaguely get the idea that RestrictedPython is a restricted subset of Python, but the documentation does not explain what is restricted and why.

The documentation should list what is restricted and give a reason as for why that is restricted, as well as list what is not restricted.

Reading the source code gives some hints:

  • Matrix multiplication (@) is currently not allowed.
  • nonlocal is not allowed.
  • await/async is not allowed.
  • There is a range function with a limit of 1000.
  • list("string") is not allowed. Why?
  • tuple("string") is not allowed. Why?

What about...

  • infinite loops such as while True?
  • recursion?
  • nested for loops?
  • "foo".zfill(99999999999999999)
  • "foo".ljust(99999999999999999, ".")
  • 1024**1024**1024
  • String repeat "foo" * 1024**1024

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions