Skip to content

Commit f1830d1

Browse files
authored
Merge branch 'master' into constant-method-option
2 parents 45eb1bf + 18396f2 commit f1830d1

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

mathics/builtin/calculus.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ class Integrate(SympyFunction):
369369
370370
Integration in TeX:
371371
>> Integrate[f[x], {x, a, b}] // TeXForm
372-
= \int_a^bf\left[x\right] \, dx
372+
= \int_a^b f\left[x\right] \, dx
373373
374374
#> DownValues[Integrate]
375375
= {}
@@ -437,12 +437,12 @@ class Integrate(SympyFunction):
437437
'Integrate[list_List, x_]': 'Integrate[#, x]& /@ list',
438438

439439
'MakeBoxes[Integrate[f_, x_], form:StandardForm|TraditionalForm]':
440-
r'''RowBox[{"\[Integral]", MakeBoxes[f, form], "\[InvisibleTimes]",
440+
r'''RowBox[{"\[Integral]","\[InvisibleTimes]", MakeBoxes[f, form], "\[InvisibleTimes]",
441441
RowBox[{"\[DifferentialD]", MakeBoxes[x, form]}]}]''',
442442
'MakeBoxes[Integrate[f_, {x_, a_, b_}], '
443443
'form:StandardForm|TraditionalForm]':
444444
r'''RowBox[{SubsuperscriptBox["\[Integral]", MakeBoxes[a, form],
445-
MakeBoxes[b, form]], MakeBoxes[f, form], "\[InvisibleTimes]",
445+
MakeBoxes[b, form]], "\[InvisibleTimes]" , MakeBoxes[f, form], "\[InvisibleTimes]",
446446
RowBox[{"\[DifferentialD]", MakeBoxes[x, form]}]}]''',
447447
}
448448

mathics/builtin/system.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,9 +408,11 @@ class UserName(Predefined):
408408

409409
def evaluate(self, evaluation) -> String:
410410
try:
411-
return String(os.getlogin())
411+
user = os.getlogin()
412412
except:
413-
return String("??user-retrieval-error")
413+
import pwd
414+
user = pwd.getpwuid(os.getuid())[0]
415+
return String(user)
414416

415417

416418
class Version(Predefined):

mathics/core/expression.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2137,7 +2137,7 @@ def __neg__(self) -> 'Rational':
21372137

21382138
@property
21392139
def is_zero(self) -> bool:
2140-
return self.numerator().is_zero and not self.denominator().is_zero()
2140+
return self.numerator().is_zero # (implicit) and not (self.denominator().is_zero)
21412141

21422142

21432143
class Real(Number):

0 commit comments

Comments
 (0)