#dev-contrib

1 messages ยท Page 91 of 1

tawdry vapor
#

Yeah but we don't know what setting the user has.

#

It's not strictly safe to assume they have it configured to push as LF.

gritty wind
#

Right

vocal prairie
#

I personally have no idea what you're talking about, so anyone in the same position as me would be hopelessly confused. Whatever you decide to implement, it should probably be simple and easy to work with without requiring long guides to set it up.

gritty wind
#

Ultimately it's one command for the user

#

But I'm trying to think of ways to bring that down to 0

#

Just have it work out of the box

vocal prairie
#

Makes sense.

gritty wind
#

Apparently the strange behavior has been documented in the readme for at least 13 months lol

tawdry vapor
#

So far I am reading that git only converts when checking out, not when checking in.

#

Never mind

#

That's what autocrlf does

#

Apparently we can avoid relying on git config by adding a .gitattributes file.

gritty wind
#

afaik

#

the two properties that exist for line endings

#

either only affect the check in, which would lead to what we have now

#

or they are overridden by the autocrlf

#

what we can do

#

is if we force the check in type

#

then we can let the hook do whatever it wants

#

or remove it completely

tawdry vapor
#

Yes, I am looking into .gitattributes right now.

#

Since we can't rely on local configs being set as we want

gritty wind
#

If possible

#

I'd like to keep the hook in some form

#

It's still a nice confirmation to have

tawdry vapor
#

If you want to ensure that text files that any contributor introduces to the repository have their line endings normalized, you can set the text attribute to "auto" for all files.

#
*    text=auto```
#

We shouldn't impose line endings locally. If people want to use CRLF, they can. If they don't, then it's on them to configure git properly. As long as we know they're being checked in as LF all is good.

gritty wind
#

I was thinking we can have the hook use the auto mode, but if text auto does the same thing, then yeah, sounds good

tawdry vapor
#

We shouldn't need the hook at all.

#

And the default behaviour is to normalise line endings to LF on check in. Someone would have to modify .gitattributes in order to disable normalisation and manage to check in CRLF.

#

It's not explicitly stated I think, but it is implied that .gitattributes takes priority over what's in .gitconfig.

gritty wind
#

Right, but if they change it and push

#

will that change be blocked somehow at any point?

#

assuming they don't push the change attrib file

tawdry vapor
#

I'm not sure if git will respect the .gitattributes file if it's not committed along with other changes.

short snow
#

I never got issues with pre commit hooks personally

#

not on vs code/vim or pycharm

balmy sparrow
#

why do we not use a subclass of HelpCommand for @dusky shore?

sleek steppe
#

^

#

Also sir-lancebot#625 needs one more review.

cold moon
#

@sleek steppe Reviewed this PR

short snow
#

bot#1446 needs review lemon_pleased

short snow
#

Seems like joe is doing the commits on github website

#

and better commit names!

patent pivot
#

lol

#

this PR will be squashed and merged

short snow
#

Lol, follow the rules!

patent pivot
#

which rules lol

#

this isn't a typical PR lol

#

it's mainly a JSON change

#

it makes sense for the blame to all be one commit in this case

short snow
#

Yeah, i was jking

patent pivot
#

lul

short snow
#

It looks weird

#

the help channel names

#

on testing

patent pivot
#

huh?

short snow
#

The sudden change from elements to fruits

patent pivot
#

ahh yeah

short snow
#

Is cucumber a fruit?

patent pivot
#

yeah

short snow
#

Add it then

#

but with gurkan instead

tough imp
#

pydis entering froot era

short snow
#

We need a changelog joe.

green oriole
#

Not yet, not yet

patent pivot
#

lol

#

yeah

#

we'll chagelog when we actually change something

tough imp
#

whoever contributed the site connection re-try is a hero

green oriole
#

I believe it is our good olโ€™ @gritty wind

tough imp
#

gone are the days of time.sleep(5); bot.run()

sleek steppe
#

@cold moon are you saying that it should take a Command as an argument or I should pass command.qualified_name?

cold moon
sleek steppe
#

Oh right, so I can just take ctx?

cold moon
#

Yep

sleek steppe
#

Ok, thanks.

wise oriole
#

https://pythondiscord.com/pages/rules/
why are there two "rules" towards the top? was it intentional? because it looks pretty 'meh'.

rules
RULES

#

or is it looking different just for me.

cold island
#

The first one is breadcrumbs I believe

wise oriole
#

wdym breadcrumbs?

cold island
#

like.. the path you take from the main page to this page

wise oriole
#

o I see

cold island
#

it's a bit more elaborate

#

because there's a longer path to the page

wise oriole
#

oh yeah I get it now

sleek steppe
#

Alright, final push sir-lancebot#625; needs one more review.

sleek steppe
#

How do you mark a requested change as addressed?

#

Or does the reviewer have to do that?

gritty wind
#

There is a button to resolve a conversation, but it might not be open to people without write access

#

Just leave a comment saying that the conversation has been addressed, and ideally include the commit

sleek steppe
#

Yeah I resolved the conversation but it didn't seem to do anything, so yeah I'll do that.

gritty wind
#

which PR are you working on?

#

Ah you resolved them

sleek steppe
gritty wind
#

Yeah they are resolved, you just need to rerequest a review from KS, or dismiss it

#

but the comment itself is done

sleek steppe
#

does it give you an option to dismiss it?

gritty wind
#

Yup, but you should probably ask for a rereview

sleek steppe
#

yeah I requested one

#

@cold moon sorry for ping, can you review one more time when you can?

cold moon
#

@gritty wind @sleek steppe Write access is required for dismissing review

sleek steppe
#

Oh I see

tough imp
#

Is there an available core dev that I could consult?
https://github.com/python-discord/branding/issues/123#issuecomment-790069902

I'm getting close to working on the validation script, so I'm wondering which direction to take. Is my proposal in the comment above reasonable? I noticed that there may be an interest in moving to poetry, so if that's still on the table, maybe we should use poetry here too? Or should we keep it super simple with a requirements.txt?

green oriole
#

I'd be fine with using requirements.txt, although I'd like to hear others opinions, especially @crude gyro's

cold moon
#

req.txt is enough for this, I think

tough imp
#

It probably is, although if someone wants to run it locally, they will have to make a venv manually

#

Or maybe they can just read the reqs with pipenv, I think it can do that

patent pivot
#

yeah reqs.txt is fine I think

crude gyro
#

I don't have a strong opinion, reqs is fine, so is poetry.

tough imp
#

okay thanks

#

probably going to use reqs then

eternal owl
patent pivot
#

Hey folks, a minor FYI, our repos are going to be transitioning from master to main. Full announcement in #dev-announcements once we're done.

tough imp
#

This is one of the things that'll need to be updated

patent pivot
#

yep, in an upcoming commit ๐Ÿ˜„

#

should be transitioned

#

just waiting for CI do loading

#

so far so good

#

WORST DAY OF MY LIFE

#

but yeah that makes sense

#

let's try again

#

๐ŸŽ‰

#

alllright let's do site next and finally lancebot

patent pivot
#

that should be everything moved after CI passes on lance

green oriole
#

Hello folks! If you are interested in diving into our help channel system, here is a P1 issue for ya: bot#1451

balmy sparrow
#

!d discord.ext.commands.MemberConverter

stable mountainBOT
#
class discord.ext.commands.MemberConverter```
Converts to a [`Member`](../../api.html#discord.Member "discord.Member").

All lookups are via the local guild. If in a DM context, then the lookup is done by the global cache.

The lookup strategy is as follows (in order):

2. Lookup by ID.

4. Lookup by mention.

6. Lookup by name#discrim

8. Lookup by name

10. Lookup by nickname

Changed in version 1.5: Raise [`MemberNotFound`](#discord.ext.commands.MemberNotFound "discord.ext.commands.MemberNotFound") instead of generic [`BadArgument`](#discord.ext.commands.BadArgument "discord.ext.commands.BadArgument")

Changed in version 1.5.1: This converter now lazily fetches members from the gateway and HTTP APIs, optionally caching the result if [`MemberCacheFlags.joined`](../../api.html#discord.MemberCacheFlags.joined "discord.MemberCacheFlags.joined") is enabled.

*await* `convert`(*ctx*, *argument*) This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).... [read more](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.MemberConverter)
balmy sparrow
#

what's up with the numbering?

#

the actual doc for comparison

gritty wind
#

The conversion is done by markdownify

#

it seems to be due to the way the html is structured

#
<li>
  ::before
  <p>Lookup by ID.</p>
</li>

This is from the docs page

#

Since it's skipping every other number

#

I think it may have to do with the ::before

glass pecan
#

That's an implied reference in chrome or firefox inspection

#

if you go to raw source, it's not there

#

it's because ::before is a valid html target by css, so showing it in inspection allows manipulation

#

it exists for each element, but only those referenced by existing css will show it

gritty wind
#

You're right

#

but there is still something that is causing it to count each element twice

#

I'm having my debugger run through it one step at a time

#

but it's painful

glass pecan
#

yeah it's a bit odd

vale ibex
#

Huh, neat. Github includes this after the rename

#

Is this an out of the box thing, or something we've put there?

gritty wind
#

out of the box

#

It won't show up for people that have never been to this repo either

#

which is neet

vale ibex
#

ahh cool

#

I'm just thinking about aiofiles for reading in files on startup

#

Is it even worth it?

#

I was all for it recently, but the realisation that it probably doesn't help much hit

gritty wind
#

Do we have files that are loaded at startup?

patent pivot
vale ibex
vale ibex
gritty wind
#

fair enough

short snow
#

can anyone check it out

#

and let me know what am doing wrong

vale ibex
#

Do you have any more detail than it doesn't work?

#

does it error or anything?

short snow
#

it doesn't load/unload when it is expected to

#

and i get errors on extractONe fuzzy wuzzy

#
  1. change the WTF_RAW_URL to some typo like mster.

Current Behaviour:
Doesn't unload the extension after hitting max failed tries. To verify it deosn't unload do .c list

Accepted Behaviour
Should unload the extension

#

can someone post the :X_square: and :o_square: from the emojis server?

#

I want to add them to my test server, for screenshot to sir-lancebot#595

dusky shoreBOT
green oriole
short snow
#

Cool thanks.

#

Chris reviewed his own PR ๐Ÿ‘€

vale ibex
#

Hah yea, I realised that I hadn't actually taken the time to review all of the code from the cogs that I've merged into one

balmy sparrow
left flume
#

Here's the code for the issues mentioned above this that i made, anyone is free to edit it or suggest some changes

balmy sparrow
left flume
#

My aim was to capitalize them

#

I did it now

#

let me update the link rq

#

done

balmy sparrow
#

also I don't see why you would use allowed_mentions there. If you're making sure the author isn't being mentioned in the reply, you can pass mention_author=False

left flume
#

oh

balmy sparrow
#

I think it'd be easier if you just make a PR, easier to comment and request changes that way

left flume
#

alright I'll change that. I asked someone in #discord-bots and they told me that

#

have a look at it now

left flume
cold island
#

Let us know if you want to open a PR, it's not too complicated

short snow
vale ibex
gritty wind
#

Vary rarely

#

Havenโ€™t seen this action failing before actually

green oriole
#

That's interesting

#

This should have been tee-ed though lemon_pensive

short snow
#

@fervent sage Can you add screenshots of the tag to your PR? For both of the tags

fervent sage
#

sure, couple mins

sturdy sphinx
#

cant talk in vc

sleek steppe
#

There should be a #voice-verification channel or something once you meet the requirements.

sturdy sphinx
sleek steppe
#

Have you sent 50 messages?

sturdy sphinx
#

no where do i send the messages?

sleek steppe
#

Anywhere I guess

vale ibex
clever wraith
#

(don't spam tho)

#

(please)

sturdy sphinx
#

ok lol

sturdy sphinx
sturdy sphinx
sturdy sphinx
short snow
#

How about changing gem_red to :gem: and then we can use it our games

#

like you earned 10 gems

crude gyro
green oriole
#

Since it is on the server you can use it inside Sir Lancebot games if thatโ€™s what you are talking about

short snow
#

Cool, can we have a combined leaderboard for all games?

green oriole
#

That sounds interesting

vocal prairie
#

So all of the leaderboards in one message?

#

If so, it would likely have to be paginated.

green oriole
#

Hmm I was thinking about combining every scores into one, no sure if that's what @short snow is thinking about

vocal prairie
#

I think each game has a different way of scoring, so it'd have to be normalized so it's semi even I think.

short snow
green oriole
#

That's an interesting idea

green oriole
#

Do you mind opening an issue @short snow?

short snow
#

We would need some type of coins for that, maybe :lemon_coins: or :py_coins"

#

for managing the points

#

A DB for that storing the points.

vale ibex
#

I worry about the persistence though, with redis there's a chance that we lose the data.

#

People may get attached to the points and be very upset if we lose them

green oriole
#

Honestly we can consider redis as persistent now

short snow
#

Yeah, hence I didn't say redis, and told about setting up a DB

green oriole
#

Even we loose the data for some reason, we have daily backups

vale ibex
vale ibex
green oriole
#

I don't think we will put a database on lancebot, like, ever

short snow
#

yeah, so only option remains redis or a simple json file ( ๐Ÿ˜› )

vocal prairie
#

Lancebot is made for beginners, or at least, it's the most beginner project out of the three. Databases are a little more advanced.

vale ibex
short snow
#

Even redis cache are lost at some point in time tho

vale ibex
#

Well, from what Akarys just said, it seems we can trust that redis is persistant

short snow
#

Maybe we can add a DB and make it optional.

vocal prairie
#

But what about when people want to make new games?

#

And they don't know how to work with DBs.

#

They might feel pressured, which is something we don't want.

short snow
#

Right, am still not sure about the redis, can someone test it out?

green oriole
#

I mean, we won't be adding a database

#

So it is either redis or something else

short snow
#

Redis seems to be the only option, the something else is probably empty

cold island
#

We scrapped the json files when we moved to kubernetes

#

@green oriole is redis even available on lancebot?

#

we don't need to allocate a volume for it?

green oriole
#

We do have redis

fallen patrol
#

isn't fact using redis?

#

.fact

#

๐Ÿ‘€

green oriole
#

We switched to it when we moved to k8s because the json file were gone

#

I believe every redis caches are on the same volume

#

Yep, only one volume per database engine

#

We have 5 of them

clever wraith
#

@vale ibex did you change your status to an RSA hash?

vale ibex
#

Not quite RSA, but I did change it

green oriole
#

Probably a base64 rickroll

clever wraith
#

I thought it was something close because of the == at the end

green oriole
#

Sigh

clever wraith
#

I was disappointed in myself when that happened

vale ibex
green oriole
#

I woooonder

clever wraith
#

You won't get me again

vale ibex
vale ibex
clever wraith
left flume
#

is there a weekly topic command?

#

if not, make a command that can send the weekly topic so that people get to know what the topic for this week is

#

it helps the users

#

something like !topic and then it sends the topic with a brief description abt it

#

and then both the command and the response are autodeleted after around 25 seconds

thorny obsidian
#

We are considering this but wanted to do it manually for a bit to ensure we don't over-engineer it from the start

clever wraith
#

How do you use the paginator? I need it for a command

gritty wind
#

Are you working on sir-lancebot or python?

clever wraith
#

Sir lancebot

gritty wind
#

It's used in a bunch of places, such as:
https://github.com/python-discord/sir-lancebot/blob/main/bot/exts/evergreen/tic_tac_toe.py#L308

You create an embed (with no data mind you, just title, color, author, etc. no fields), and you pass it with a list of whatever you want to paginate

clever wraith
#

what databases does python use?

gritty wind
gritty wind
clever wraith
#

Ah

gritty wind
#

though python doesn't do the interaction directly

clever wraith
#

Thank you

gritty wind
#

it is handled by the API

#

We also have redis for data that we want to persist, but wouldn't be the end of the world if we lost

vocal prairie
#

I think the 100K banner needs to be removed from the site seeing as we're already at 160K.

clever wraith
#

how often do you guys make backups?

gritty wind
gritty wind
#

we use lemon's

clever wraith
vocal prairie
#

Using http requests.

clever wraith
#

there's ipc made for this

vocal prairie
#

Any bots can do that as long as they can make http requests.

gritty wind
gritty wind
vocal prairie
#

Discord bot's do that for their websites, so I don't see why Python couldn't.

#

Though I may be wrong.

patent pivot
#

We could probably do it

#

I don't know that it's a worthy investment of time or infra

clever wraith
patent pivot
#

How live are we talking

green oriole
dusky shoreBOT
clever wraith
patent pivot
#

oh yeah that's fairly fine

green oriole
#

We have a counter

#

!server

stable mountainBOT
#
Server Information

Created: 4 years, 2 months and 7 days ago
Voice region: europe
Features: DISCOVERABLE, PARTNERED, RELAY_ENABLED, VIP_REGIONS, PREVIEW_ENABLED, INVITE_SPLASH, BANNER, WELCOME_SCREEN_ENABLED, ANIMATED_ICON, MEMBER_VERIFICATION_GATE_ENABLED, NEWS, VANITY_URL, COMMUNITY
Roles: 81
Member status: status_online 47955 status_offline 114357

Members: 162313

Helpers: 91
Moderators: 28
Admins: 13
Owners: 3
Contributors: 36

Channels: 213

Category: 27
News: 10
Staff: 54
Text: 112
Voice: 10

vocal prairie
clever wraith
#

also, could we auto block link shortners?

green oriole
#

Can you comment on the issue please?

gritty wind
#

Do you have a specific one in mind?

green oriole
#

Frick, I clicked the button

vocal prairie
#

What exactly do you want to replace the 100K banner?

clever wraith
gritty wind
#

not have a banner

green oriole
#

I will just ask scrag first, since he had some ideas for it

vocal prairie
#

How would I test it? Should I clone the repo and then open it locally?

gritty wind
#

Yeah that's the best option

#

If you're on windows, it may or may not be impossible to run the site without docker

#

though it isn't too bad

vocal prairie
#

I opened the website locally following the guide, but this is all I see. The css stuff didn't apply. Is there something I need to do differently?

#

This is the url
file:///C:/Users/myname/site/pydis_site/templates/home/index.html

gritty wind
#

Ah

#

You should serve the site instead of trying to access the files directly

vocal prairie
#

How do I do that?

gritty wind
#

well, if you are on windows, that would just be docker-compose up

vocal prairie
#

Oh.

#

I can do that.

gritty wind
vocal prairie
#

Thank you!

tough imp
#

I may need some help setting up CI for the branding repo ๐Ÿ˜ญ

#

I'm not sure what needs to be done when adding a workflow from a fork

#

I've added a workflow that should trigger on PRs, un-drafted the PR and resolved conflicts, but it's not being picked up

tawdry vapor
#

I think it's a security measure for it to not run workflows on forks

#

I may have understood it incorrectly, so don't take my word for it.

#

Maybe not. It is set to allow all

#

I'm not sure if this setting is applying to workflows or to specific actions.

#

Yeah it's the latter. So the jury is still out on whether workflows created in forks are allowed.

tough imp
#

I'm able to run the workflow in my fork, and if I remember correctly just adding a new workflow yaml is enough for it to start being used

#

So it probably has something to do with the fork

#

Can branch protection be set or does the workflow have to run at least once for it to appear there?

tawdry vapor
#

I can't find any clear documentation on this.

#

I'm guessing right now that the workflow has to be present in the target branch, and then the check will run. And even if it is present in the target, I'm not sure what happens if the workflow is modified by source branch that's in a fork.

tough imp
#

Okay, it's not the end of the world, I can demonstrate that it works in my fork

vocal prairie
#

Out of pure curiosity, what do you use Github Actions to do? Does it check the code in some way?

tawdry vapor
#

Linting, testing, and deployment.

tawdry vapor
#

There's an attribute and a function with the same name...

#

I guess the function is defined before the attribute, since the attribute is in __init__.

vocal prairie
#

It might work, but it might be cleaner for it to be not the same.

clever wraith
#

Still nothing on unsplash verification @patent pivot ?

patent pivot
#

yes, I've heard back from them, just needed to verify that we use the UTM links but otherwise we are good for prod

vocal prairie
#

I'm having an issue with using the hosts file to see the website.
This is my hosts file. When I open http://pythondiscord.local and the others, nothing occurs.

clever wraith
#

.src earth

vocal prairie
#

Nothing from either of them.

patent pivot
#

uhhh

#

how are you running it

#

it should definitely be :8000

vocal prairie
#

Locally from my computer. I have the github repo cloned.

patent pivot
#

right, but the local setup uses 8000

#

what command are you running?

#

pipenv run start? or using docker

clever wraith
#
patent pivot
clever wraith
#

Wacky

patent pivot
#

lol

clever wraith
#

Ok lol I didn't watch the video did now

patent pivot
#

prob because you can't expect people to reveal source code

clever wraith
#

True even though it's open source

vocal prairie
#

I ran pipenv run start just now and was faced with a bunch of errors.

patent pivot
clever wraith
#

True

cold island
tawdry vapor
#

I already submitted a PR

short snow
#

Arenโ€™t nominations part getting handled by ks?

#

why are they in dev bounty board then

cold island
#

Thanks, that was outdated

gritty wind
#

Like

#

At all

#

What do you see when

#

You type docker container ps

vocal prairie
#

I'm not at my computer right now, but I'll check tomorrow.

glass pecan
#

@vocal prairie Hi there, i see you're interesting on working on site's frontpage's stage 2 design. With the next stage, most of the work was going to be a few new graphical assets to be placed in prominent positions on the page. If you've done some graphic design / illustration work in the past and feel comfortable getting creative and drawing something up based on a written guideline, let me know. If it feels a bit out of your comfort zone though, that's absolutely fine, we'll get around to it eventually.

vocal prairie
#

I've done some graphics, but not to much.

#

Placing I can do, but the drawing, maybe not as well.

glass pecan
#

the placing won't be a problem, as the structure shouldn't be undergoing any major changes.

#

Stage 1 handled that

short snow
#

sir-lancebot#593 's label needs to changed to status: approved, since chris has already opened a pr for this

short snow
#

and it is approved ig

glass pecan
#

is it?

short snow
#

sir-lancebot#576 for this too

short snow
#

same thing

glass pecan
#

as what

short snow
#

as 593

glass pecan
#

gotcha, just reading them over

short snow
glass pecan
#

you linked 428 twice

short snow
#

ah yes my bad

#

470 and 412 are also mentioning the same change

glass pecan
#

kinda weird that 428 is dealing with 418

#

alright, cleaned up

short snow
#

Alright cool

short snow
sleek steppe
#

Does sir-lancebot#475 really matter because sir-lancebot#625 was merged?

sleek steppe
#

Oops I meant sir-lancebot#470

dusky shoreBOT
fallen patrol
#

isn't there something to prevent this from occuring?

#

or, that should anyhow

brazen charm
#

Only for tags

fallen patrol
#

hm

#

shouldn't resources be a tag?

#

so there needs to be a cooldown on that sub command

gritty wind
#

!src site_resources

stable mountainBOT
#
Bad argument

Unable to convert 'site_resources' to valid command, tag, or Cog.

gritty wind
#

Oh well, it's a command

brazen charm
#

It's a site subcomand, not sure if there is a reason for that

fallen patrol
#

!src resources

stable mountainBOT
#
Command: site resources

Info about the site's Resources page.

Source Code
gritty wind
#

we can add a cooldown to it

#

but hmm

fallen patrol
#

it wouldn't be hard

#

a single line of code

gritty wind
#

I know

#

it's not about the implementation

#

it's about if we want this change or not

brazen charm
#

I'd say moving it to a tag would be the better way, the only dynamic thing for it, the faq and others is the url which we don't really care about changing

gritty wind
#

Also doesn't the rate limit send a large embed too

fallen patrol
#

hm

#

not with tags

brazen charm
#

the cooldown code would need to be generalized if it'd be applied here too so it's not a one line change, but I don't see a good reason for it being a command instead of a tag

vale ibex
#

So for bot#1451 I'm thinking of splitting the current HelpChannels.idle_minutes into two, idle_minutes_author and idle_minutes_helper, thoughts?

green oriole
#

Yeah, that sounds good

#

Maybe not helpers since it can be confused with the role

vale ibex
#

ah yea true, that's a good point

#

idle_minutes_non_author?

green oriole
#

Maybe just users?

#

Or others

vale ibex
#

well i'll go with the split for now anyway, we can bike shed the name in the PR

green oriole
#

I don't really think we should bikesheed it haha

vale ibex
#

๐Ÿ˜‚

green oriole
#

Just put what you think fit the best

vale ibex
#

๐Ÿ‘

patent pivot
#

@clever wraith @gritty wind hello i bring good news

vocal prairie
#

What's that?

patent pivot
#

the API for the .earth feature

#

we've been granted access to the higher ratelimit API

#

5k reqs/hr vs. 50 reqs/hr

vocal prairie
#

Nice!

clever wraith
#

Hell yeah!

#

It can be changelogged now!

#

Thanks for telling me @patent pivot

patent pivot
#

๐Ÿ‘Œ

#

any admin can changelog when available, bit afk tonight

vale ibex
#

So this enhancement will likely need us to fetch quite a few message from the history of the channel, to find the last message made by the author

#

are there rate limit concerns?

#

atm we do channel.history(limit=1).next() to get the last message every 30 minutes

#

my current thoughts of implementation would mean we do channel.history(limit=100/200) to get some more history, to determine the last author's message

#

but this would mean doing so after 10 minutes of in-activity in each channel

#

The only other option I can really see if to have an on_message listener and store the time of the author of each channel's last message in redis

#

hmmm, actually it wouldn't be so bad, we can short circuit the check if there is activity in the last 10 minutes

#

Thanks for being my rubber duck

short snow
sleek steppe
short snow
#

Yeah that sounds a better approach

green oriole
#

didihearchangelogneeded

clever wraith
#

yesyoudidakarys

green oriole
#

.earth

dusky shoreBOT
green oriole
#

Alrighty

clever wraith
#

.earth

#

@green oriole now, time for that changelog

#

.help

#

I guessed as much

green oriole
#

Will finish my cooking and then post the changelog

clever wraith
#

Ooh what's cookin'?

green oriole
#

Assuming that nobody does it in the meantime

#

A zucchini terrine of some kind, nothing too fancy haha

cold island
sleek steppe
#

Have the listener only for when the owner last sent the message?

sleek steppe
#

So then it won't break when the bot goes down, and we wouldn't worry about rate limits.

clever wraith
#

Whoa I've been changelogified

sleek steppe
#

I mean yet to be changelogified lemon_pensive

clever wraith
#

You'll get there

green oriole
sleek steppe
#

Yeah but there're not too many issues that are open and I can actually work on lemon_pensive

sleek steppe
#

is anyone taking bot#1454?

sleek steppe
#

or is it even going to be approved lemon_thinking

clever wraith
#

Could someone look at sir-lancebot#611

dusky shoreBOT
sleek steppe
# dusky shore

For this issue ^^ should we log anything if someone who isn't "OP" reacts?

vale ibex
#

bot#1470 is up now! thanks to @whole forge @worthy plume @spare plaza @slim widget and @mellow hare for the group coding ๐Ÿ˜„

sleek steppe
#

is this fine?

log.debug("Got reaction from non-whitelisted user")
vale ibex
#

Do we already have a debug statement on reaction add?

sleek steppe
#

Yes

vale ibex
#

If so, maybe we can add to that whether its from a whitelisted user?

#

Haven't seen your implementation, so if the logic is too complicated to do that, another one isn't too bad

sleek steppe
#

no it would be changing one line

vale ibex
#

Would make sense to do that yea

vocal prairie
#

Can I close bot#1454 because of bot#1471?

vocal prairie
#

Or is it better to wait until it's closed by 1471?

brazen charm
#

No, it should be closed when the implementation is merged, in this case github will do it automatically

vocal prairie
#

I'm new to this Github stuff, so I didn't know. Thank you!

sleek steppe
#

Speaking of bot#1471...it needs some reviewing ๐Ÿ™‚

tawdry vapor
#

This approach doesn't work because it the event will get triggered for any emoji

#

Or rather, triggered by anyone.

#

Oh it's in an infinite loop so it tries again

sleek steppe
#

Yep

tawdry vapor
#

But why couldn't you just remove the reaction within the check?

sleek steppe
#

Checks are sync functions

tawdry vapor
#

Use create_task then. I think the problem with relying on the infinite loop is that you may end up missing a reaction event.

sleek steppe
#

I see

tawdry vapor
#

Well..... it's complicated

#

We have to consider when context switches occur

#

Cause discord.py will only dispatch the event if the event loop is executing that code

#

Yeah i think I am right cause await message.remove_reaction causes a context switch and will allow a new event to be dispatched before a wait_for attaches to it again.

sleek steppe
#

Or not since it already relies on an infinite loop?

tawdry vapor
sleek steppe
#

oh

tawdry vapor
#

But yeah, both could be in the check I suppose.

#

That's my opinion anyway

#

I would agree it's a bit confusing for a predicate function to have side effects like deleting a reaction, but it seems like the most convenient way to have correct behaviour.

sleek steppe
#

would something like this be fine?

try:
    return (
        # Conditions for a successful pagination:
        all((...,
    ))
)
finally:
    if not no_restrictions:
        await ctx.bot.remove_reaction(reaction_.emoji, user_)
#

well not the await

#

create_task

tawdry vapor
#

You don't need try finally. Just save it to a variable and check it before returning it

sleek steppe
#

oh ok

sleek steppe
#

@tawdry vapor I made those changes ๐Ÿ™‚

sleek steppe
#

Does anyone else want to review bot#1471

short snow
#

Chris, shouldnโ€˜t the idle time of the author be less than the others?

#

in your PR it is the other way round

#

Looks like same is said in the issue

#

closes help channels more quickly if the OP (the person who originally opened the channel) has not responded in a while.

#

Your config default.

thorny obsidian
#

"The initial implementation suggestion is that 10 minutes after the last user message, and 30 minutes after the last OP message the channel will be closed."

#

From the implementation. The intended behavior is that if the OP isn't responding to messages, meaning other people have posted, we close it more quickly

#

If the OP is still talking and is the last message, we don't necessarily want it to go stale faster

#

So Chris's PR is correct.

short snow
#

Wait, if the intended behavior is to close the help channel faster if the OP isnโ€™t responding, then shouldnโ€™t that time be less.
Like if the op isnโ€™t responding for 30 minutes and other ppl have went on talking, then it would stop after 30min, since according the comment, it says both criteria to be met

thorny obsidian
#

Anytime OP talks, the timer is reset to 30 minutes

#

If it's been over 30 minutes since the OP has talked, but other people are talking, we lower the time to close the channel since OP isn't part of the convo

short snow
#

Ok I understood it.

#

Thanks

thorny obsidian
#

So instead of a channel potentially being open for 60 minutes if the OP sends a message and someone responds just before it closes, the channel will only be open for 40 minutes

short snow
#

In here, instead of adding a extra check, why not just make the author, the restricted user?

short snow
#

well @whole forge , what was the shortest explanation you ppl could come up with?

whole forge
#

probably the one in the docstring you also reviewed, _cog.py line 46-48

short snow
#

ok, lemme see

#
Closes after 30 min since the last message, or 10 min since the last claimant message, or when you do !close.
#

this is short

#

ig

green oriole
#

I think that's a bit too wordy

short snow
#

can you test it on a int e and show how it looks

green oriole
#

I don't have access to int e

#

But I think this embed should be as short as possible, when opening a new channel you don't need to know the exact details of how it works

exotic ember
#

@sleek steppe I'll send it here so we don't clutter #dev-log
The command is pipenv run precommit, notice there's no dash between pre and commit

cold moon
#

I think pre-commit runs pre-commit instead Pipenv

exotic ember
#

yes, but it doesn't install the git hook

sleek steppe
#

Oh ok

exotic ember
#

also, the check still doesn't return a boolean in all cases:

        if whitelisted:
            return True

        elif right_reaction:
            bot.instance.loop.create_task(reaction.message.remove_reaction(reaction.emoji, user))
            return False

if both whitelisted and right_reaction is false, then the function returns None

sleek steppe
#

oh right

#

Fixed

#

Now can someone review bot#1471?

vale ibex
#

This is what the embed looks like after that change

#

@short snow @green oriole

#

Can add it to the PR after work

vocal prairie
#

Nice bot name! And yeah, that footer works well, but what do you think about "closes after a period of inactivity"?

#

I think that might be a little clearer on what you mean by idle.

#

Because that's a term used in Discord, and you wouldn't want to cause confusion.

vale ibex
#

I just think I'm against trying to explain exactly how it works, since it'll cause more questions

#

if people are genuinely interested then they can ask here

#

Trying to explain the complex logic behind it in a short sentence will lead to confusion and people asking for more info

vocal prairie
#

Yeah, the system doesn't need to be explained. I just thought that since "idle" is a term used in Discord, it may be confusing.

vale ibex
#

agreed.

#

!remind 4h this

stable mountainBOT
#
You're the boss!

Your reminder will arrive in 4 hours!

exotic ember
#

I like that suggestion too ^

sleek steppe
#

For bot#1432

  1. Can I take it?

If so:

2: Would increasing the cutoff for difflib.get_close_matches be better or will it make things worse?

3: Would it be better to just take the really long messages like the one in the screenshot and make it say Did you mean: !paste Lorem ipsum dolor... or remove the additional text entirely?

dusky shoreBOT
vocal prairie
#

@sleek steppe Take it in a string, cut off everything that isn't the first word, and then provide the suggestion?

sleek steppe
#

I guess that makes sense

keen valley
#

Which project are currently your are working

#

All the people contributing

#

I will try my best to contribute in the project

vocal prairie
#

If you're interested, feel free to look through any of the issues on the github.

#

@dusky shore is a good starter project from what I've heard.

vale ibex
#

.src

dusky shoreBOT
vale ibex
#

Take a look at the issues in this repo and see if any take your interest ๐Ÿ˜„

#

@dusky shore is a good introduction to our open source projects

sleek steppe
short snow
short snow
sleek steppe
short snow
#

Oh well nvm, i thought the pr mentioned another change as well.

#

i will give it a review.

stable mountainBOT
#

@vale ibex

It has arrived!

Here's your reminder: ![this](https://cdn.discordapp.com/emojis/470903994118832130.webp?size=128 "this").
[Jump back to when you created the reminder](#dev-contrib message)

tranquil topaz
#

@clever wraith this channel

#

staff members or contributers that are active here are able to answer you better then what i can ๐Ÿ˜„

vale ibex
#

Yea, I think your final sentence sums it up quite well

vocal wolf
#

I think there was something to do with privacy reasons

#

moving the message into a paste

#

Something something @patent pivot probably remembers more or less why this could possibly be a weird legal thing

vale ibex
#

because we're moving data from being hosted by discord, to being hosted by us

#

without explicit consent

#

But yea, Joe might be able to give us a final view on it

#

It's a good idea! We appreciate people taking an interest in our projects ๐Ÿ˜„

vocal wolf
#

It's a pretty dank idea conceptually, but legality is always an odd thing to deal with

sleek steppe
#

What does it mean to squash a merge?

#

How do they do that then?

green oriole
green oriole
sleek steppe
#

What's the command to do that then?

sleek steppe
#

do the same thing

green oriole
#

No, because in this case the user posted it directly

#

They implicitly agreed to our privacy policy, at least I believe

#

Yep

#

Well

#

By joining the community

patent pivot
#

there are a few reasons we've not gone down this route

green oriole
#

Joe plz help

patent pivot
#

it isn't entirely legality/privacy

#

it's more like

#

this will just result in huge snippets in the server, it's better to just educate people to use the web ui

#

a !paste command is fine legality/privacy wise because people have already kinda said "aight" since they are calling a command

#

the legality/privacy stuff came in when people proposed we yoinked just general code blocks

#

but yeah, in general we've been fairly against allowing pastes directly from Discord before

fallen patrol
#

@patent pivot
In a hypothetical situation, how would an off-topic name be changed earlier than normal?

patent pivot
#

...

#

with the... channel menu?

#

you seem very fascinated that a channel changed name

fallen patrol
#

well, I wasn't sure if there would be a bot command or not.

patent pivot
#

not really

#

no need for that

#

if we really want to we can generate a name with an eval snippet

fallen patrol
#

yes, I would think that there might be an ot name update command or something to update an offtopic name earlier than normal

#

oh

patent pivot
#

if we want to rename all three we can trigger that, else we can make an API call to roll a new name

fallen patrol
#

so using the channel menu wouldn't actually put it in the list

#

โ€ฆduh

patent pivot
#

the current name for the channel you are fascinated by is in the pool

#

it just won't be marked as used, so the only side effect is it may be used again before the pool is empty

fallen patrol
#

I mean

#

there

#

that channel

patent pivot
#

wat

fallen patrol
patent pivot
fallen patrol
#

๐Ÿ‘€

#

I won't tell but you can probably figure it out

patent pivot
#

yeah I mean I presume it's just a DM channel lol

fallen patrol
#

โ€ฆ

sharp timber
#

That's probably the DM channel ID. Shows as #deleted-channel for everyone else who can't access it

fallen patrol
#

it is.

#

smh

#

๐Ÿ˜”

sleek steppe
#

Do you think bot#1472 should be for sir-lancebot or @stable mountain ?

dusky shoreBOT
sleek steppe
#

I wanted it to be a command like !pypi

clever wraith
#

sir-lancebot, as i said on the issue

vocal prairie
#

I think Sir-Lancebot.

vocal prairie
#

Not mandatory, but it's a nice added benefit.

clever wraith
#

it's kinda nice, but not mandatory

sleek steppe
#

A lot of python's commands aren't "mandatory"

#

like !reddit is the equivalent to this

#

The reason I opened it in bot instead of sir-lancebot is so that people can be like: hey, you need foo, there's a github repo for this. !github user/bar

vocal prairie
#

Reddit is for server management.

clever wraith
#

mhm

sleek steppe
#

That's a webhook though

vocal prairie
#

Yes, but Sir Lancebot doesn't do that stuff.

#

Lancebot is meant to be simple.

#

And Python controls that webhook afaik.

thorny obsidian
#

@sleek steppe Something like !github is not integral to how we run or manage the server, so I would not put it in Python. Python is also much more complicated in terms of development and even getting a running version of it.

sleek steppe
#

Alright I understand

#

Should I open an issue in sir-lancebot?

clever wraith
#

sure

brazen charm
#

The issue can be moved

thorny obsidian
#

(that also leaves me curious why pypi is in python, but I'm not quite as in the loop as I should be about our dev projects)

sleek steppe
#

Yeah the pypi command is the only reason I opened it in bot

#

Because sometimes you want to pip install git+... instead of pip install package

clever wraith
#

yea lol

#

nice for installing forks

short snow
#

I agree, pypi should be moved to sir lancebot, along sith github issue

vocal wolf
#

@thorny obsidian pypi was put in @stable mountain since I thought of it as a pretty darn useful utility

green oriole
#

It is a command to interact with the key python infrastructure, like the !pep command, it think it fits here

sleek steppe
#

For .github, I should change how they send the embed because they're adding empty fields and it looks pretty bad on mobile

short snow
#

using or

sleek steppe
short snow
#

oh ok, what difference does it cuz, can you show visually

vale ibex
#

!embed \u200b

stable mountainBOT
#

\u200b

vale ibex
#

Guess it escapes characters like that, nevermind ๐Ÿ˜„

sleek steppe
short snow
#

right, remove it.

#

why was it added at the first place pithink

gritty wind
#

!source github

stable mountainBOT
#
Bad argument

Unable to convert 'github' to valid command, tag, or Cog.

sleek steppe
#

I have no idea lol

gritty wind
#

what bot is it on

#

.src github

sleek steppe
#

Yea

dusky shoreBOT
#
Command: github

Fetches a user's GitHub information.

Source Code
gritty wind
#

Yeah no info in the commit

#

alright, annihilate it

short snow
#

for sir-lancebot#630, we can just change the decerator to take the everyone role in roles=. right?

cold island
#

Why do we need the decorator if we want everyone to use it everywhere?

short snow
#

because by defauly, sir lancebot is restricted to only some channels.

#

.c4

#

see^

brazen charm
#

It uses the class attribute

sleek steppe
#

i.e. ALLOWED_CHARACTERS

short snow
#

Right, missed that, thanks

short snow
sleek steppe
#

@tawdry vapor I don't want to flood the PR with questions, is it fine to make a utility function like this:

def suppress_callable(func: Callable, exceptions, *args, **kwargs):
    with suppress(*exceptions):
        return func(*args, **kwargs)
short snow
#

bot#1446 sir-lancebot#605 sir-lancebot#614 and sir-lancebot#618 needs review lemon_pleased

fallen patrol
#

Idea: sirlancebot bm command using message references?

balmy sparrow
#

I like this idea plus1 maybe make an issue for it

vestal heath
#

can you explain more ?

static canyon
dusky shoreBOT
#
Are you trying to kill me?

Your input was invalid: target_message is a required argument that is missing.

Usage:
.bookmark <target_message> [title=Bookmark]

static canyon
#

Like that would bookmark your message because I referenced (replied to) it

fallen patrol
#

boo

static canyon
#

!d discord.Message.reference

stable mountainBOT
#
reference```
The message that this message references. This is only applicable to messages of type [`MessageType.pins_add`](#discord.MessageType.pins_add "discord.MessageType.pins_add"), crossposted messages created by a followed channel integration, or message replies.

New in version 1.5.

Type Optional[[`MessageReference`](#discord.MessageReference "discord.MessageReference")]
fallen patrol
#

this thing is the reference

vestal heath
#

oh ok, the time bm command was made reference were not a thing.
Might even pull a PR with a previous pending PR

fallen patrol
#

yei figured

#

you made it?

clever wraith
#

.src bm

tawdry vapor
sleek steppe
#

oh that makes sense

#

I should have thought of suppressing it in the done callback

sleek steppe
#

And tested create_task to see if it suppresses it

sleek steppe
#

Also, should the github command really have a 60 second cooldown?

#

If so, maybe like 3 times per minute or like once every ten seconds?

#

@gritty wind Apparently, they added empty fields to the github command so that there's 2 inline fields per line instead of 3. This is the old and new embeds in pc:

gritty wind
#

I don't mind the new one, but if you wanna keep the old one, add comments plz lol

sleek steppe
#

And on mobile

#

I think it's worth removing the embeds

#

empty fields**

sleek steppe
balmy sparrow
#

imo a minute shouldn't hurt, i'm not linking github profiles and repos more than once a minute at any given time

sleek steppe
#

alright 1 minute cooldown it is

#

per group or per command?

vale ibex
#

@tawdry vapor Ignore my last comment, I don't think it'll be that easy. I'll look for a better solution

sleek steppe
#

@tawdry vapor can you review my PR again when you get the chance?

sleek steppe
#

So, how's this so far?

#

This is the most I can get without making multiple requests

short snow
#

lemon_hyperpleased Awesome

#

We donโ€™t need github info

#

just keep it

#

ToxicKids/sir-lancebot

#

no need of back ticks also

#

Can we get stars?

#

owner is not needed

#

we can understand that by the embed title

sleek steppe
#

Yeah guess so

short snow
#

Language is only the top one or all of them?

sleek steppe
#

Sometimes it's None, maybe if there's multiple it's None but I'm not sure

#

wait nvm there's multiple languages in snakebox (technically)

#

But when I did other repos it came out as None

#

like bot for example

short snow
#

Hmmm

#

Can you show the github api url

sleek steppe
#

Wait never mind it's showing up now

#

looks like the top one

short snow
#

oh ok

#

Do you use the users api or there is a api for repo (am not aware of)

short snow
#

Add stargazers and license, remove owner
you can possibly add pr and issue count with the help of emojis

sleek steppe
#

Is there pr and issue count?

short snow
#

Just issue count,

#

issues are prs included in github

sleek steppe
#

Right now I'm seeing open_issue_count

short snow
#

Yes thats it

vocal prairie
#

Question. How did you guys make the mailing list channel? Is that webhook service that email services provide, or is it something more complex.

short snow
vocal prairie
#

I see. Thank you!

whole forge
short snow
#

owner is already mentioned in the embed title, why do you want to put it twice?

glass pecan
#

so he can click it to go directly to their profile in github

#

it's quite a common thing to want to do, so i agree it's probably important to keep it (in link form) in some form or another.

short snow
#

Well, you can click on the repo and see the owner profile.

glass pecan
#

they can, but i'm sure you know we already knew that

#

yet we still say it's a good addition

short snow
#

Or better:

#

owner(url)/repo(url) in embed title

glass pecan
#

that's certainly a good idea too

#

i don't mind the exact implementation honestly, just so long as it exists

#

the hyperlinking of individual parts of the repo url though is dependant on how they best want to format the embed

#

if they have it as a title, it isn't possible

short snow
#

Well, am not a fan of long embeds, hence asked.

#

Especially on mobiles

glass pecan
#

changing the formatting doesn't always necessitate removing something that exists in a part that's being suggested to be changed

#

if it's mostly the fields that's a sticking point for you (they are for me, but i was going to build an alternative first as a comparison), then it can, like you said, be used elsewhere

green oriole
short snow
#

why?

glass pecan
#

the hyperlinking of individual parts of the repo url though is dependant on how they best want to format the embed
if they have it as a title, it isn't possible

#

it's a set url

green oriole
#

Markdown links doesn't work in title

#

Yep

short snow
#

Righttt

green oriole
#

There is a singular url field you can add

glass pecan
#

for example, this is how i'm reproducing the existing example above

green oriole
#

But that's it

glass pecan
#
embed = discord.Embed(
    title="**`python-discord/sir-lancebot`'s Github Info**",
    url="https://github.com/python-discord/sir-lancebot/",
    description="A Discord bot started as a community project for Hacktoberfest 2018, later evolved into an introductory project for aspiring new developers starting out with open source development."
)
embed.add_field(name="Language", value="Python")
embed.add_field(name="Forks", value="[144](https://github.com/python-discord/sir-lancebot/network/members)")
embed.add_field(name="Owner", value="[python-discord](https://github.com/python-discord)")
embed.set_footer(text="Repository created at โ€ข 03/10/21")
await ctx.send(embed=embed)
#

whoops, left in the wrong owner

short snow
#

Add the owner as the author with the Owner's profile pic and name, idk if that's possible

green oriole
#

just pretend that it is a fork

glass pecan
#

which gives this

#

so you can see the url field now ๐Ÿ™‚

green oriole
#

How does it look on mobile?

glass pecan
#

anyways

#

not great

#

fields aren't side by side on mobile

green oriole
glass pecan
#

anyways, imma build an alternative like i was saying

#

and suggest some possible improvements

#

brb

short snow
#

Hence I was being picky on the fields, maybe just add them as bold text?

#
**name**
value
#

but then you can't add manyy "fields"

#

Ok, I will try some alternatives

glass pecan
#

if you want to recommend a different formatting, i'd suggest probably trying to build one too

#

it's so much nicer being able to see it as a real thing

#

is there a point to showing forks tho pithink

#

wouldn't stars be better

#

even then, probably not all that fussed on either of them

short snow
#

Probably we should plan which all fields do we want

#

First

sharp timber
#

Threw a brief test together

sleek steppe
#

Can you have emojis in the footer?

sharp timber
#

Good question

#

no

#

You can have unicode emojis but they don't get rendered

#

\๐Ÿ‘

vocal prairie
#

Markdown hyperlinks don't work in embed title.

sharp timber
#

\โญ

vocal prairie
#

Only the inbuilt ones.

sharp timber
vocal prairie
#

Oh nice.

#

What I mean by inbuilt is the field that Discord provides for links in titles.

sharp timber
#

yeah

#

I didn't know if it supported so just threw it in to test, looks like it doesnt

#
        emb = discord.Embed(
            title="Sir-Lancebot Github",
            url="https://github.com/python-discord/sir-lancebot",
            description="By [python-discord](https://github.com/python-discord)\n\nA Discord bot started as a community project for Hacktoberfest 2018, later evolved to an introductory project for aspiring new developers starting out with open source development. ",
            timestamp=timestamp,
        )
        emb.set_footer(text="144 โ‘‚ โ€ข 105 โญ")
        await message.channel.send(embed=emb)
vocal prairie
#

It's works, nice!

sleek steppe
#

I should keep the forked from part if it's a fork right

short snow
#

last updated?

sharp timber
#

that or created date

#

goal was to match what other people were using just formatted differently

vocal prairie
#

Timestamp is usually the time that the embed was sent.

short snow
#

that would do, less number of fields, idt forks are needed tho

sharp timber
#

What I ended up settling on, but just here for ideas

short snow
#

longgg footer, no need of forks i think

glass pecan
sharp timber
#

Yeah

glass pecan
#

hmm

#

it's a bit plain

#

maybe not then

sharp timber
short snow
#

ok cool! you can assign it to me

sleek steppe
#

"stargazers_count" is this the stars?

vocal prairie
#

I think so.

#

The number of people who starred it, yes.

sleek steppe
#

Alright got it

vocal prairie
#

Is there a way to remove the dot after last commit?

#

It makes it rather confusing.

gritty wind
#

Which dot?

sleek steppe
vocal prairie
#

Can you make it not a timestamp, and just a value with a date?

sleek steppe
#

Ok, how should I format it?

vocal prairie
#

Actually, never mind.

#

We want it to follow system time.

sleek steppe
#

And this is a fork

vocal prairie
#

That's good.

sleek steppe
#

Would a search command be good also?

sleek steppe
#

Would sir-lancebot#610 need a status: waiting for author label?

dusky shoreBOT
short snow
#

No need for fork imo

#

Count of fork ^

vocal prairie
#

It's small.

#

And it's good info.

#

So it seems fine.

cold island
#

I don't know why I wrote it like that, but is there a difference?

sharp timber
#

no

#

you could argue its clearer

cold island
#

Which one

sharp timber
#

list()

#

oh wait

#

They are different

#

You need the first one, the second will break

#

!e ```py
stuff = {"a": 1}
print([stuff.items()])
print(list(stuff.items()))

stable mountainBOT
#

@sharp timber :white_check_mark: Your eval job has completed with return code 0.

001 | [dict_items([('a', 1)])]
002 | [('a', 1)]
sleek steppe
#

yes but list(gen_comp) is the same as list_comp

cold island
#

aaah yeah there's a parenthesis there

#

It's not the same

glass pecan
#

ones slower

sleek steppe
#

and list(gen_comp) is slower than list_comp

sharp timber
#

Yeah, but it's not Counter(thing) for thing in stuff, it's Counter(thing for thing in stuff).items()

cold island
#

In the first one I'm turning .items() into an explicit list, the second will give me a list with an items iterator object

glass pecan
#

oh true, it will too

cold island
#

So it's not a list() with a genexp

glass pecan
#

it'll be an item, not converted

#

good eye

sharp timber
#

a little * can fix it

green oriole
#

Unpacking in list comps when

glass pecan
#

it exists

green oriole
#

Too bad it isnโ€™t a thing

#

Well

sharp timber
green oriole
#

You can add an outer loop

#

but it is pretty verbose

sleek steppe
#

Oh I didn't see the )

glass pecan
#

it'll be a mess if you do it like that, yes ak

#

lol