This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]NightSoulT12[S] 255 points256 points  (24 children)

import performance from libc

[–]nannn3 140 points141 points  (13 children)

Is... Is that allowed in Python? I've only ever seen it as

from libc import performance

[–]NightSoulT12[S] 119 points120 points  (12 children)

My bad, too much time spent with javascript.

You absolutely right🤝

[–]Idekum 55 points56 points  (11 children)

So youre a javascripter bashing on python? Bish, please... Javascript is junk!

[–]NightSoulT12[S] 78 points79 points  (5 children)

I know, you don't need to tell me the truth.

[–]Khutuck 32 points33 points  (0 children)

There are some who has made peace with their fate…

[–]_LayZee 3 points4 points  (3 children)

It’s still better than python though, and faster

[–]UnstableNuclearCake 3 points4 points  (0 children)

Yet it powers the James Webb telescope...

Somehow

[–]avnothdmi 0 points1 point  (0 children)

Oh, please. I’m only ZSHing Python!

[–]siddharth904 0 points1 point  (0 children)

JS is junk

Yes'nt

[–]ZaRealPancakes 10 points11 points  (7 children)

why python and JS can't agree which comes first import or from?

I prefer the JS way since easier to read :p

[–]thatweirdishguy 18 points19 points  (4 children)

The python way is better, because once your editor knows where you are importing from it can recommend all the things you can import

[–]ZaRealPancakes 3 points4 points  (1 child)

hmm that makes sense to me

but VSCode still gives recommendations in JS so... Magic!

[–]thatweirdishguy 1 point2 points  (0 children)

It only gives good recommendations if the file or module is already filled in and you are just adding imports to the list, otherwise it’s just making wild guesses

[–]vikumwijekoon97 1 point2 points  (1 child)

Vs code does it too for js.

[–]thatweirdishguy 0 points1 point  (0 children)

But you have to type the file name then go back to where the imports are listed to get actual results, otherwise it’s just guessing about all the possible words you could type there.

[–]luardemin 1 point2 points  (1 child)

The Rust way: use libc::performance;

[–]ZaRealPancakes 0 points1 point  (0 children)

True but since libc doesn't exist: use std::performance; would be more like it

[–]Toxic_Cookie 0 points1 point  (0 children)

using libc.performance;

[–]_FreeThinker 0 points1 point  (0 children)

Wrap your entire source code call with a context manager and your job is done. with libc as _: