Loxodrome script not running The code below throws an

AttributeError: 'bpy_prop_collection' object has no attribute 'link'

How does context.scene.objects.link(loxodrome) look in Blender 2.8?
import bpy

from mathutils import Vector
from math import radians, sin, cos, tan, sqrt, floor

context = bpy.context

def loxodrome_points(spirals, revs, angle_step=10):
    a = 1 / spirals
    degs = floor(360 * revs / 2)
    segs = [radians(d) for d in range(-degs, degs, angle_step)]
    points = []
    for t in segs:
        den = sqrt(1 + a * a * t * t)
        x = cos(t) / den
        y = sin(t) / den
        z = - a * t / den
        l = Vector((x, y, z))
        points.append(l)     
    return points


points = loxodrome_points(10, 10)
#loxodrome = bpy.data.objects.get(&quot;Loxodrome&quot;)
#if loxodrome is None:
if True:
    loxocurve = bpy.data.curves.new(&quot;loxo&quot;, 'CURVE')
    loxocurve.dimensions = '3D'
    loxocurve.resolution_u = 2
    spline = loxocurve.splines.new('NURBS')
    spline.points.add(count=len(points) - 1)

    for i, bp in enumerate(spline.points):
        x, y, z = points[i]
        bp.co = (x, y, z, 1)

    loxodrome = bpy.data.objects.new(&quot;Loxodrome&quot;, loxocurve)    
    context.scene.objects.link(loxodrome)
Figured it out quite quickly.
The last line has to be substituted by:
context.collection.objects.link(loxodrome)

That's it!