Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Darkly)
  • No Skin
Collapse
Brand Logo
Eric MatthesE

ehmatthes@fosstodon.org

@ehmatthes@fosstodon.org
About
Posts
7
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

View Original

Posts

Recent Best Controversial

  • Can someone explain this #Python import behavior
    Eric MatthesE Eric Matthes

    @bmispelon

    > whose multiple settings files were importing from each other

    You are not the only one who would be confused, please do not mention this in office hours

    Uncategorized python

  • Can someone explain this #Python import behavior
    Eric MatthesE Eric Matthes

    @bmispelon Can you share the real-world motivation for this question at some point?

    Uncategorized python

  • Can someone explain this #Python import behavior
    Eric MatthesE Eric Matthes

    @bmispelon Here's my VSCodium session:

    Uncategorized python

  • Can someone explain this #Python import behavior
    Eric MatthesE Eric Matthes

    @bmispelon Then I ran c.py in a VS Codium debugger session, watching A.

    - A starts as undefined (everything does).
    - After the first line of a.py, A is 1, but I think that VS Codium is actually reporting a.A.
    - The import in a is hit, and A goes to undefined. I think VSC is showing b.A.
    - b's import runs, and A is 1. I think that's b.A.
    - The second line of b is run, and A is 2.
    - Execution goes back to c, where the value of A is 2.

    Uncategorized python

  • Can someone explain this #Python import behavior
    Eric MatthesE Eric Matthes

    @bmispelon My initial guess was 2. c first imports a.A, which is 1. But the call to import from a loads a.py. That includes the call to import * from b, which imports from a. So at that point, A is 1. b then adds one to A, which sets A at 2. Then execution returns to c, with A at 2. So I think the value of A in c comes from b.

    I tried to verify this in a pdb session, but stepping through at a low enough level to see this was bringing me into even lower level Python functions.

    Uncategorized python

  • yeaaah...
    Eric MatthesE Eric Matthes

    @quinn Absolutely, and if anyone thinks this is new you can find the same kind of reporting from 2023:

    https://www.theatlantic.com/ideas/archive/2023/11/substack-extremism-nazi-white-supremacy-newsletters/676156/

    Uncategorized

  • Another blastingly cold morning here in #Asheville, but heating way up for 40F with luck today, so some of the snow will shift.
    Eric MatthesE Eric Matthes

    @czarbucks It was 1F here in Brevard this morning! I wasn’t expecting it to get quite that cold overnight.

    Uncategorized asheville ncwx snow
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups