Question: I want to change guest VM's(Windows) IP address on ESXi. One way I have known is using RDP to connect to the guest OS and modifying the network configuration.

However, I wish to make the process automated. Hence, does vCenter or ESXi contain similar functions or tools to perform this demand? (I have tried ovftool and vCLI but not work)

Thanks for ur reply.

Rocas

Answer: 
**Why is `n` the exact same Object as `None`?**

The C implementation keeps a singleton instance. `NoneType.__new__` is returning the singleton instance.

**Why was the language designed such that n is the exact same Object as `None`?**

If there was not a singleton instance, then you could not rely on the check `x is None` since the `is` operator is based on identity. Although `None == None` is also `True`, it's possible to have `x == None` be `True` when `x` is not actually `None`. See [this answer](https://stackoverflow.com/a/14247383/1464861) for an example.

**How would one even implement this behavior in python?**

You can implement this pattern by overridding `__new__`. Here's a basic example:

```
class Singleton(object):
  _instance = None
  def __new__(cls, *args, **kwargs):
    if Singleton._instance is None:
      Singleton._instance = object.__new__(cls, *args, **kwargs)
    return Singleton._instance

if __name__ == '__main__':
  s1 = Singleton()
  s2 = Singleton()
  print 's1 is s2:', s1 is s2
  print 'id(s1):', id(s1)
  print 'id(s2):', id(s2)

```

Output:

> 
> s1 is s2: True   
> 
>  id(s1): 4506243152   
> 
>  id(s2): 4506243152   
> 
> 
> 
> 

Of course this simple example doesn't make it *impossible* to create a second instance.
> 
> Why is n the exact same Object as None? 
> 
> 
> 

Many immutable objects in Python are [interned](http://en.wikipedia.org/wiki/String_interning) including `None`, smaller ints, and many strings.

Demo:

```
>>> s1='abc'
>>> s2='def'
>>> s3='abc'
>>> id(s1)
4540177408
>>> id(s3)
4540177408    # Note: same as s1
>>> x=1
>>> y=2
>>> z=1
>>> id(x)
4538711696
>>> id(z)
4538711696    # Note: same as x

```

> 
> Why was the language designed
>  such that n is the exact same Object as None? 
> 
> 
> 

See above -- speed, efficiency, lack of ambiguity and memory usage among other reasons to intern immutable objects.

> 
> How would one even
>  implement this behavior in python?
> 
> 
> 

Among other ways, you can override `__new__` to return the same object:

```
class Singleton(object):
    _instance = None
    def __new__(cls, *args, **kwargs):
        if not cls._instance:
            cls._instance = super(Singleton, cls).__new__(
                                cls, *args, **kwargs)
        return cls._instance

```

For strings, you can call [intern](http://docs.python.org/2/library/functions.html#intern) on Python 2 or [sys.intern](http://docs.python.org/3.3/library/sys.html#sys.intern) on Python 3