assignment ( = )
augmented assignment ( += , -= etc.)
comparisons ( == , < , > , != , <> , <= , >= , in , not in , is , is not )
Booleans ( and , or , not )
### BAD
from RevitServices.Persistence import DocumentManager
DocumentManager = DM
doc = DM.Instance.CurrentDBDocument
uiapp = DM.Instance.CurrentUIApplication
### GOOD
from RevitServices.Persistence import DocumentManager as DM
doc = DM.Instance.CurrentDBDocument
uiapp = DM.Instance.CurrentUIApplication
### BAD
rotateToCoord = rotateFromCoord.Rotate(solid.ContextCoordinateSystem.Origin,Vector.ByCoordinates(0,0,1),5)
### GOOD
toCoord = fromCoord.Rotate(solid.ContextCoordinateSystem.Origin,Vector.ByCoordinates(0,0,1),5)
### BAD
function( apples[ 1 ], { oranges: 2 } )
### GOOD:
function(apples[1], {oranges: 2})
### BAD
if x == 2 : print x , y ; x , y = y , x
### GOOD
if x == 2: print x, y; x, y = y, x
### BAD
function (1)
### GOOD
function(1)
### BAD
# get the country code
country_code = get_country_code(address)
# if country code is US
if (country_code == 'US'):
# display the form input for state
print form_input_state()
### GOOD
# display state selection for US users
country_code = get_country_code(address)
if (country_code == 'US'):
print form_input_state()
public Cuboid singleCube(){
var output = Cuboid.ByLengths(1,1,1);
for(int i = 0; i<10000;i++){
output = Cuboid.ByLengths(1,1,1);
}
return output;
}
public Cuboid singleCube(){
var output = Cuboid.ByLengths(1,1,1);
var toDispose = new List<Geometry>();
for(int i = 0; i<10000;i++){
toDispose.Add(Cuboid.ByLengths(1,1,1));
}
foreach(IDisposable item in toDispose ){
item.Dispose();
}
return output;
}