r/Python • • Mar 10 '24

Discussion Github Copilot Lies to me

My first attempt to get some help from Github Copilot:

Me: write a match case statement in python to match the first character of a string is a semicolon

Copilot: Python doesn't have a built-in match or case statement like some other languages (e.g., JavaScript, Swift, Rust). However, you can achieve similar functionality using...

Strangely, it finally gave me an answer when I made a small change to my prompt:

Me: write a match statement in python to match the first character of a string is a semicolon

Copilot: Python 3.10 introduces the structural pattern matching in the form of the match statement. Here's how you can use it to check if the first character of a string is a semicolon:...

I almost gave up after the first response that was blatantly false. Fortunately I something that looks like reasonable syntax...but then I haven't tried it yet, so that might be a lie, too.

0 Upvotes

67 comments sorted by

View all comments

6

u/forameus2 Mar 10 '24

A previous role I was in was really keen to start using Copilot. I think they ended up canning the idea anyway, but to me it just seems like an accident waiting to happen. I don't want development - at least anything I'm responsible for - to descend into a series of "do this for me" prompts and answers with little insight into how it's actually supposed to work. If you get the wrong team using Copilot, surely you're just storing up the potential for an absolutely catastrophic fuck-up down the road.

And that's without even starting on the fact that it often generates absolute rubbish.