Skip to content

Commit

Permalink
Update depencies (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
robert3005 authored Nov 3, 2023
1 parent 799bbca commit bce88bb
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 35 deletions.
4 changes: 2 additions & 2 deletions fibonacci/_lib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Fibonacci:
A class that computes the Fibonacci numbers.
"""

def __init__(first_n, /):
def __init__(self, first_n, /):
pass
def __iter__(self, /):
"""
Expand All @@ -22,7 +22,7 @@ class FibonacciIterator:
An iterator that computes the Fibonacci numbers.
"""

def __init__(i, ith, next, stop, /):
def __init__(self, i, ith, next, stop, /):
pass
def __next__(self, /):
"""
Expand Down
52 changes: 26 additions & 26 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["poetry-core", "ziggy-pydust==0.13.4"]
requires = ["poetry-core", "ziggy-pydust==0.19.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
Expand All @@ -22,9 +22,9 @@ script = "build.py"
python = "^3.11"

[tool.poetry.group.dev.dependencies]
ziggy-pydust = "0.13.4"
ziggy-pydust = "0.19.0"
pytest = "^7.4.0"
ruff = "^0.0.292"
ruff = "^0.1.3"
black = "^23.7.0"

[tool.black]
Expand Down
11 changes: 7 additions & 4 deletions src/fib.zig
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ pub const Fibonacci = py.class(struct {

first_n: u64,

pub fn __new__(args: struct { first_n: u64 }) !Self {
return .{ .first_n = args.first_n };
pub fn __init__(self: *Self, args: struct { first_n: u64 }) void {
self.first_n = args.first_n;
}

// Get an iterator over the first `self.first_n` Fibonacci numbers.
Expand All @@ -64,8 +64,11 @@ pub const FibonacciIterator = py.class(struct {
next: u64,
stop: u64,

pub fn __new__(args: struct { i: u64, ith: u64, next: u64, stop: u64 }) !Self {
return .{ .i = args.i, .ith = args.ith, .next = args.next, .stop = args.stop };
pub fn __init__(self: *Self, args: struct { i: u64, ith: u64, next: u64, stop: u64 }) void {
self.i = args.i;
self.ith = args.ith;
self.next = args.next;
self.stop = args.stop;
}

pub fn __next__(self: *Self) !?u64 {
Expand Down

0 comments on commit bce88bb

Please sign in to comment.