Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import-outside-toplevel does not check from x import y imports #3175

Closed
ghost opened this issue Oct 9, 2019 · 0 comments
Closed

import-outside-toplevel does not check from x import y imports #3175

ghost opened this issue Oct 9, 2019 · 0 comments
Milestone

Comments

@ghost
Copy link

ghost commented Oct 9, 2019

Steps to reproduce

  1. Create a file a.py containing:
def get_pi_0():
    import math
    return math.pi

def get_pi_1():
    from math import pi
    return pi
  1. Run pylint a.py

Current behavior

There is a lint failure: a.py:3:4: C0415: Import outside toplevel (math) (import-outside-toplevel)
There is no such failure for get_pi_1.

Expected behavior

Lint failures for both get_pi_0 and get_pi_1.

pylint --version output

pylint 2.4.2
astroid 2.3.1
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)]
@PCManticore PCManticore added this to the Next minor release milestone Oct 9, 2019
billwert pushed a commit to dotnet/performance that referenced this issue Oct 30, 2019
* Remove name `dotnet-gc-infra` from the README is this is not named that any more.
* Remove `FirstToLastEventSeconds` metric, prefer `TotalSecondsTaken` instead.
* host_info.yaml now describes the processor ranges contained by each numa node.
* Support finalizable objects in GCPerfSim, similar to pinned objects
* Add `--show-reasons` flag to `analyze-single`
	- print a summary of reason counts over all GCs
	- print reasons for each individual GC in the single-gcs section
* Enhance `--print-processes` with support for arbitrary run metrics
	* Will show nothing if not a CLR process
	* To do this, must support getting ProcessedTrace objects for each individual process from a trace,
	  resulting in some refactoring in process_trace.py
* Added `--no-readjust` parameter to make_memory_load.c.
  This means there is only an initial memory load but it never frees or allocates afterwards.
  This may be more fair as a test, as a GC that consumes less memory shouldn't be punished by another process taking up more memory.
* Support `coreclr_specific` in a config. This allows configs to be different for different coreclrs.
  This was useful as older coreclrs parsed `complus_gcheapaffinitizeranges` differently.
* Convert test_status metrics to direct properties of ProcessedTrace so they're easier to use from jupyter notebook
* Add new metrics AllocedMBAccumulated and MemoryPressure
* Add new configurations, and `bgc_stepping`, `bgc_tuning_loh`, `bgc_tuning_soh` reasons.
	(For testing dotnet/coreclr#26695)
* Support all document output args (e.g. `--output-width`) on all document-creating commands
* Add `NO_DEFAULT` as an alternative to `MISSING`; allows a dataclass to inherit from another which has fields without defaults.
* pylint fixed pylint-dev/pylint#3175 , now must add more disables where this was violated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant