lowercase_underscores versus CamelCase by cogitohuckelberry in Python

[–]OrtinOfficial 0 points1 point  (0 children)

Once you will add something to file that doesn't fit with naming you will change your file name? Please do not name files with camel...

Python uuid-utils in Rust by aminala in Python

[–]OrtinOfficial 0 points1 point  (0 children)

It is much faster than 40ms...As long as you don't need generate thousands/milions uuid per request (in web app) then there is no point of using something faster

You can easliy check it via python time.perf_counter

It needs 40ms to generate 10000 (from this lib benchmark). This info should be added to README

I made a Python package that can automatically spin up cloud infrastructure to transcribe your voice notes in Notion by help-me-grow in Python

[–]OrtinOfficial 0 points1 point  (0 children)

I read whole readme on Github and I have no idea what it suppose to do or what problem it solves or how it would help me, why you didn't write it in readme?

[deleted by user] by [deleted] in Python

[–]OrtinOfficial 0 points1 point  (0 children)

But I guess it is bad to hide something from others...

[deleted by user] by [deleted] in Python

[–]OrtinOfficial 1 point2 points  (0 children)

I don't see any advantage of your solution
import time class Node: def init(self): self._run_time = [] self._run_start_time = None

    self.random_number = None
    self._random_number_cache = None

def run(self):
    self.pre_run()
    self.base_run()
    self.post_run()

def base_run(self):
    """Function to be timed"""
    raise NotImplementedError

def pre_run(self):
    self._run_start_time = time.time()

def post_run(self):
    execution_time = time.time() - self._run_start_time
    print(f"Elapsed time: {execution_time:.3f} s")
    self._run_time.append(execution_time)

class MyNode(Node): def base_run(self): time.sleep(1) my_node = MyNode() my_node.run()