Skip to content

Commit 6f8e06a

Browse files
drew-512Drew O'Meara
andauthored
all: minor comment and typos cleanups
Co-authored-by: Drew O'Meara <drew@plan-systems.org>
1 parent 1815995 commit 6f8e06a

File tree

10 files changed

+19
-12
lines changed

10 files changed

+19
-12
lines changed

py/bigint.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func BigIntCheckExact(obj Object) (*BigInt, error) {
5555
return bigInt, nil
5656
}
5757

58-
// Checks that obj is exactly a bigInd and returns an error if not
58+
// Checks that obj is exactly a BigInt and returns an error if not
5959
func BigIntCheck(obj Object) (*BigInt, error) {
6060
// FIXME should be checking subclasses
6161
return BigIntCheckExact(obj)
@@ -65,7 +65,7 @@ func BigIntCheck(obj Object) (*BigInt, error) {
6565

6666
// Convert an Object to an BigInt
6767
//
68-
// Retrurns ok as to whether the conversion worked or not
68+
// Returns ok as to whether the conversion worked or not
6969
func ConvertToBigInt(other Object) (*BigInt, bool) {
7070
switch b := other.(type) {
7171
case Int:

py/bool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func (a Bool) M__repr__() (Object, error) {
5252

5353
// Convert an Object to an Bool
5454
//
55-
// Retrurns ok as to whether the conversion worked or not
55+
// Returns ok as to whether the conversion worked or not
5656
func convertToBool(other Object) (Bool, bool) {
5757
switch b := other.(type) {
5858
case Bool:

py/bytes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ func (a Bytes) M__repr__() (Object, error) {
187187

188188
// Convert an Object to an Bytes
189189
//
190-
// Retrurns ok as to whether the conversion worked or not
190+
// Returns ok as to whether the conversion worked or not
191191
func convertToBytes(other Object) (Bytes, bool) {
192192
switch b := other.(type) {
193193
case Bytes:

py/complex.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func ComplexNew(metatype *Type, args Tuple, kwargs StringDict) (Object, error) {
4242

4343
// Convert an Object to an Complex
4444
//
45-
// Retrurns ok as to whether the conversion worked or not
45+
// Returns ok as to whether the conversion worked or not
4646
func convertToComplex(other Object) (Complex, bool) {
4747
switch b := other.(type) {
4848
case Complex:

py/float.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ var floatDivisionByZero = ExceptionNewf(ZeroDivisionError, "float division by ze
118118

119119
// Convert an Object to an Float
120120
//
121-
// Retrurns ok as to whether the conversion worked or not
121+
// Returns ok as to whether the conversion worked or not
122122
func convertToFloat(other Object) (Float, bool) {
123123
switch b := other.(type) {
124124
case Float:

py/int.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ func cantConvert(a Object, to string) (Object, error) {
216216

217217
// Convert an Object to an Int
218218
//
219-
// Retrurns ok as to whether the conversion worked or not
219+
// Returns ok as to whether the conversion worked or not
220220
func convertToInt(other Object) (Int, bool) {
221221
switch b := other.(type) {
222222
case Int:

py/none.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func (a NoneType) M__repr__() (Object, error) {
3333

3434
// Convert an Object to an NoneType
3535
//
36-
// Retrurns ok as to whether the conversion worked or not
36+
// Returns ok as to whether the conversion worked or not
3737
func convertToNoneType(other Object) (NoneType, bool) {
3838
switch b := other.(type) {
3939
case NoneType:

py/run.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,11 @@ func RunSrc(ctx Context, pySrc string, pySrcDesc string, inModule interface{}) (
135135
}
136136

137137
// RunCode executes the given code object within the given module and returns the Module to indicate success.
138+
//
138139
// If inModule is a *Module, then the code is run in that module.
140+
//
139141
// If inModule is nil, the code is run in a new __main__ module (and the new Module is returned).
142+
//
140143
// If inModule is a string, the code is run in a new module with the given name (and the new Module is returned).
141144
func RunCode(ctx Context, code *Code, codeDesc string, inModule interface{}) (*Module, error) {
142145
var (

py/string.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ func (a String) M__imul__(other Object) (Object, error) {
300300

301301
// Convert an Object to an String
302302
//
303-
// Retrurns ok as to whether the conversion worked or not
303+
// Returns ok as to whether the conversion worked or not
304304
func convertToString(other Object) (String, bool) {
305305
switch b := other.(type) {
306306
case String:

stdlib/stdlib.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ type context struct {
4747

4848
// NewContext creates a new gpython interpreter instance context.
4949
//
50-
// See type Context interface for info.
50+
// See interface py.Context defined in py/run.go
5151
func NewContext(opts py.ContextOpts) py.Context {
5252
ctx := &context{
5353
opts: opts,
@@ -109,6 +109,7 @@ func (ctx *context) ModuleInit(impl *py.ModuleImpl) (*py.Module, error) {
109109
return module, nil
110110
}
111111

112+
// See interface py.Context defined in py/run.go
112113
func (ctx *context) ResolveAndCompile(pathname string, opts py.CompileOpts) (py.CompileOut, error) {
113114
err := ctx.pushBusy()
114115
defer ctx.popBusy()
@@ -202,7 +203,7 @@ func (ctx *context) popBusy() {
202203
ctx.running.Done()
203204
}
204205

205-
// Close -- see type py.Context
206+
// See interface py.Context defined in py/run.go
206207
func (ctx *context) Close() error {
207208
ctx.closeOnce.Do(func() {
208209
ctx.closing = true
@@ -216,7 +217,7 @@ func (ctx *context) Close() error {
216217
return nil
217218
}
218219

219-
// Done -- see type py.Context
220+
// See interface py.Context defined in py/run.go
220221
func (ctx *context) Done() <-chan struct{} {
221222
return ctx.done
222223
}
@@ -274,6 +275,7 @@ func resolveRunPath(runPath string, opts py.CompileOpts, pathObjs []py.Object, t
274275
return err
275276
}
276277

278+
// See interface py.Context defined in py/run.go
277279
func (ctx *context) RunCode(code *py.Code, globals, locals py.StringDict, closure py.Tuple) (py.Object, error) {
278280
err := ctx.pushBusy()
279281
defer ctx.popBusy()
@@ -284,10 +286,12 @@ func (ctx *context) RunCode(code *py.Code, globals, locals py.StringDict, closur
284286
return vm.EvalCode(ctx, code, globals, locals, nil, nil, nil, nil, closure)
285287
}
286288

289+
// See interface py.Context defined in py/run.go
287290
func (ctx *context) GetModule(moduleName string) (*py.Module, error) {
288291
return ctx.store.GetModule(moduleName)
289292
}
290293

294+
// See interface py.Context defined in py/run.go
291295
func (ctx *context) Store() *py.ModuleStore {
292296
return ctx.store
293297
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy