Question: I'm writing a crossplatform python script on windows using Eclipse with the Pydev plugin. The script makes use of the `os.symlink()` and `os.readlink()` methods if the current platform isn't NT.

Since the `os.symlink()` and `os.readlink()` methods aren't available on the Windows platform Pydev flags them as undefined variables--like so:

[![eclipse_undef_variable](https://farm5.static.flickr.com/4030/4582418253_e3db0277ac_o.png)](http://www.flickr.com/photos/chris_nullptr/4582418253/ "eclipse_undef_variable by chris.nullptr, on Flickr")

### Question:

Is there a way to ignore specific undefined variable name errors *without* modifying my source file?

**edit**: I found a way to ignore undefined variable errors from [this answer](https://stackoverflow.com/questions/2112715/how-do-i-fix-pydev-undefined-variable-from-import-errors/2248987#2248987) on stackoverflow.  

I'll leave the question open in case there is a way to solve this using project file or Pydev setting.

Answer: 
I suspect pydev may have better, specific solutions, but what about just putting some code at the start of your program, such as:

```
if not hasattr(os, 'symlink'): os.symlink = None

```

Yeah, it's a hack, but, unless pydev *does* have specialized solutions (unfortunately I don't know of any, but then I'm no pydev expert;-), may be better than nothing...
I noticed PyDev doesn't recognize ZeroMQ constants so I struggled with the same problem. 

I found PyDev has a settings option in `Preferences > PyDev > Code Editor > Code Analysis` : `Undefined`-tab. Just write `symlink` and `readlink` there (comma separated) to remove the errors.

Still not optimal, but good enough for now.