Opened 8 years ago

Closed 8 years ago

#16529 closed enhancement (fixed)

In python 3.x, reload() is renamed to imp.reload()

Reported by: aapitzsch Owned by:
Priority: major Milestone: sage-6.4
Component: misc Keywords: python3
Cc: Merged in:
Authors: André Apitzsch Reviewers: Wilfried Luebbe
Report Upstream: N/A Work issues:
Branch: 8abf46a (Commits, GitHub, GitLab) Commit: 8abf46a0495084eeb227fe770ec272d4ab4f4a29
Dependencies: Stopgaps:

Status badges

Description

Rename reload() to imp.reload().

Change History (5)

comment:1 Changed 8 years ago by aapitzsch

  • Branch set to u/aapitzsch/ticket/16529
  • Commit set to 8abf46a0495084eeb227fe770ec272d4ab4f4a29
  • Status changed from new to needs_review

New commits:

8abf46arename reload() to imp.reload()

comment:2 Changed 8 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:3 Changed 8 years ago by wluebbe

I could not find imp.reload in the Python 2.7 documentation!

But trying it gives:

>>> sys.version
'2.7.8 (default, Oct 20 2014, 15:05:19) \n[GCC 4.9.1]'
>>> type(reload)
<type 'builtin_function_or_method'>
>>> import imp
>>> type(imp.reload)
<type 'builtin_function_or_method'>

So it is available! It's just missing in the docs.

And for comparison:

>>> sys.version
'3.4.2 (default, Oct  8 2014, 13:08:17) \n[GCC 4.9.1]'
>>> type(reload)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'reload' is not defined
>>> import imp
>>> type(imp.reload)
<class 'function'>

comment:4 Changed 8 years ago by wluebbe

  • Reviewers set to Wilfried Luebbe
  • Status changed from needs_review to positive_review

Looks good and all test pass.

comment:5 Changed 8 years ago by vbraun

  • Branch changed from u/aapitzsch/ticket/16529 to 8abf46a0495084eeb227fe770ec272d4ab4f4a29
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.