Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • erp5 erp5
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Merge requests 142
    • Merge requests 142
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedinexedi
  • erp5erp5
  • Merge requests
  • !1266

patches/Restricted: allow random.Random

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Jérome Perrin requested to merge feat/restricted_random into master Sep 18, 2020
  • Overview 12
  • Commits 1
  • Pipelines 1
  • Changes 2

all member of random module are available (because in ZopeGuards, there's a random.__allow_access_to_unprotected_subobjects__ = 1), SystemRandom class also is, but Random class was not, even though there should be nothing unsafe in this.

This is needed if we want to use a random number generator with a fixed seed to get reproductible results. We could use random.seed module level function but since this is also used by several things in ERP5 this does not produce reproductible sequences.

Edited Sep 18, 2020 by Jérome Perrin
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: feat/restricted_random
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7