Skip to content

Commit d908b0a

Browse files
antonsyndclaude
andcommitted
fix(core): add Slice.GetSlice overload for Bytes and update skip reasons
- Add GetSlice(Bytes, int?, int?, int?) to Slice.cs, delegating to bytes.Slice() - Un-skip bytes_slicing fixture (now passes) - Update stdlib_collections_defaultdict.skip with issue references (#553-555) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8b14c28 commit d908b0a

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/Sharpy.Compiler.Tests/Integration/TestFixtures/bytes_slicing.skip

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DefaultDict codegen issues: #553 (factory function), #554 (generic type args), #555 (missing key default)

src/Sharpy.Core/Slice.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,5 +150,14 @@ public static string GetSlice(string str, int? start, int? end, int? step)
150150
return sb.ToString();
151151
}
152152
}
153+
154+
/// <summary>
155+
/// Slice a Bytes using Python slice semantics.
156+
/// Used by generated code for bytes[start:stop:step] expressions.
157+
/// </summary>
158+
public static Bytes GetSlice(Bytes bytes, int? start, int? end, int? step)
159+
{
160+
return bytes.Slice(start, end, step);
161+
}
153162
}
154163
}

0 commit comments

Comments
 (0)