News for hackers. Stuff that matters.
Re:Python Entry Points Explained by jwilk on Friday July 28, 2017 @11:16AM (#14874835)
Entry points are excellent at making your scripts start slooooooooow.

Compare

  $ time python -m pyflakes /dev/null
  
  real	0m0.225s
  user	0m0.103s
  sys	0m0.008s
with

  $ time pyflakes /dev/null
  
  real	0m2.468s
  user	0m1.738s
  sys	0m0.055s
Re:Python Entry Points Explained by ericfrederich on Friday July 28, 2017 @01:07PM (#14875750)
I did not get as dramatic of results as you.

  # python3 -m venv example
  # source example/bin/activate
  (example) # pip install pyflakes
  Collecting pyflakes
    Downloading pyflakes-1.5.0-py2.py3-none-any.whl (225kB)
      100% || 225kB 892kB/s 
  Installing collected packages: pyflakes
  Successfully installed pyflakes-1.5.0
  (example) # time for i in {00..99}; do python -m pyflakes /dev/null; done
  real    0m7.167s
  user    0m6.407s
  sys 0m0.750s
  (example) # time for i in {00..99}; do pyflakes /dev/null; done
  
  real    0m7.661s
  user    0m6.894s
  sys 0m0.753s
Re:Python Entry Points Explained by jwilk on Friday July 28, 2017 @02:18PM (#14876331)
I guess it gets worse when you have more stuff installed in the environment.
Re:Python Entry Points Explained by gizmo385 on Friday July 28, 2017 @11:25AM (#14874909)
I've noticed that using argparse makes my scripts start very slow, especially if you expose a large number of option. I have a script that I wrote for work that has quite a variable number of available options and it can sometimes take several seconds for the script to startup and actually begin doing anything useful.
Re:Python Entry Points Explained by yes_or_gnome on Friday July 28, 2017 @12:24PM (#14875415)
Argparse's source is possibly the most difficult lib to grow from the stdlib. https://github.com/python/cpython/blob/master/Lib/argparse.p...

For me, it is not debugable. I wanted to propose and start a reference implementation for supporting --[no-]bool-opt, but I quickly gave up. There's some solutions on SO, but none of them are sufficient. The best solution makes --bool-opt mutually exclusive to --no-bool-opt which will cause a hard failure which is not okay for shell aliases.