jmoney-main ~ master # pip search salt
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/pip/commands/search.py", line 43, in run
pypi_hits = self.search(query, options)
File "/usr/local/lib/python2.7/dist-packages/pip/commands/search.py", line 60, in search
hits = pypi.search({'name': query, 'summary': query}, 'or')
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Watch version | |
my-file-watch: | |
file.managed: | |
- name: /etc/file.conf | |
- source: salt://file.conf | |
my-service-watch: | |
service.running: | |
- name: my-service | |
- watch: | |
- file: my-file-watch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The `cmd` state implements its own `onlyif` and `unless` requisites. This sls demonstrates how they are interpreted. | |
{%- if grains['kernel'] == 'Linux' %} | |
echo onlyif true: | |
cmd.run: | |
- onlyif: | |
- '[ "a" = "a" ]' | |
echo onlyif false: | |
cmd.run: | |
- onlyif: |
- Is it possible to get
IntA.__new__
to return an object of typeIntA
without calling__new__
on the parent class? - Is this situation unique to integer or builtin types?
>>> class IntA(int):
... def __new__(cls, i=0):
... return i
...
>>> class IntB(int):
... def __new__(cls, i=0):
... return int.__new__(cls, i)
Why are only the properties defined in __init__
listed in the __dict__
attribute of an instance of the class?
Python 3.4.3 (default, Jan 11 2016, 09:37:52)
[GCC 4.9.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> class C(object):
... prop_1 = 'value 1'
... def __init__(self):
... self.prop_2 = 'value 2'
... def set_prop_3(self):
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ID == name | |
/file/one: # ID and name | |
file.absent: | |
# ID != name | |
remove file one: # ID | |
file.absent: | |
- name: /file/one # name | |