title: Python PATH .is_file() evaluates symlink as a file
body: <p>In my Python3 program, I take a bunch of paths and do things based on what they are.  When I evaluate the following symlinks (snippet):</p>
  
  <pre><code>lrwxrwxrwx  1  513  513        5 Aug 19 10:56 console -&gt; ttyS0
  lrwxrwxrwx  1  513  513       11 Aug 19 10:56 core -&gt; /proc/kcore
  lrwxrwxrwx  1  513  513       13 Aug 19 10:56 fd -&gt; /proc/self/fd
  </code></pre>
  
  <p>the results are:</p>
  
  <pre><code>symlink   console -&gt; ttyS0
  file      core -&gt; /proc/kcore
  symlink   console -&gt; ttyS0
  </code></pre>
  
  <p>It evaluates <em>core</em> as if it were a file (vs a symlink).  What is the best way for me to evaluate it as a symlink  vs a file? code below</p>
  
  <pre><code>#!/usr/bin/python3
  import sys
  import os
  from pathlib import Path
  
  def filetype(filein):
      print(filein)
      if Path(filein).is_file():
          return "file"
      if Path(filein).is_symlink():
          return  "symlink"
      else:
          return "doesn't match anything"
  
  if __name__ == "__main__":
  file = sys.argv[1]
  print(str(file))
  print(filetype(file))
  </code></pre>