Event JSON
{
"id": "2aa6a51dac3c169c94a9e5b96ad739797ae341b4b34bb862e1c78e196caf6db5",
"pubkey": "a071462e960207a7a2272a3f59d042e59623bb2217b56f9365cba21e12213e3e",
"created_at": 1715165854,
"kind": 1,
"tags": [
[
"imeta",
"url https://assets.chaos.social/media_attachments/files/112/404/991/103/475/549/original/bbcf49c0a18de1f9.png",
"m image/png"
],
[
"proxy",
"https://chaos.social/@scy/112405109433355128",
"web"
],
[
"t",
"python"
],
[
"t",
"import"
],
[
"imeta",
"url https://assets.chaos.social/media_attachments/files/112/404/982/685/324/303/original/d9fe8204280437f3.png",
"m image/png"
],
[
"imeta",
"url https://assets.chaos.social/media_attachments/files/112/404/903/465/292/262/original/f9754d96ce6c20a0.png",
"m image/png"
],
[
"imeta",
"url https://assets.chaos.social/media_attachments/files/112/404/910/820/650/681/original/b2587c8885109a06.png",
"m image/png"
],
[
"proxy",
"https://chaos.social/users/scy/statuses/112405109433355128",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://chaos.social/users/scy/statuses/112405109433355128",
"pink.momostr"
]
],
"content": "Imports in Python can be confusing.\n\nI just saw someone ask \"why do I have to prepend a dot to import a file in the same directory?\"\n\nThat depends on whether the file with the import statement is in a package or not.\n\nBut, whether Python considers it to be in a package depends on how you imported (or ran) _that_ file. You can't determine it from the file's content or the filesystem structure!\n\nCheck alt text (image description) for explanations of the examples.\n\n#Python #import\nhttps://assets.chaos.social/media_attachments/files/112/404/903/465/292/262/original/f9754d96ce6c20a0.png\nhttps://assets.chaos.social/media_attachments/files/112/404/910/820/650/681/original/b2587c8885109a06.png\nhttps://assets.chaos.social/media_attachments/files/112/404/982/685/324/303/original/d9fe8204280437f3.png\nhttps://assets.chaos.social/media_attachments/files/112/404/991/103/475/549/original/bbcf49c0a18de1f9.png\n",
"sig": "fdc317856eabb24f3e9f2e09bf7ae01091d162f057df8563e9135a0cac7b3a85c06cba3758f9a526f06ff5f93888bd344de5a9ad0d165cff0d9c73db00d29dbd"
}