WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
pub struct FragmentRepr(Vec<FragmentRepr>);
pub fn accepted(mut entry: &mut FragmentRepr) {
loop {
let FragmentRepr(ref mut discrs) = *{entry};
entry = &mut discrs[0];
}
}
pub fn rejected(mut entry: &mut FragmentRepr) {
loop {
let FragmentRepr(ref mut discrs) = *entry;
entry = &mut discrs[0];
}
}
fn main() {}

Rust accepts the first function, but rejects the second with "error: cannot borrow entry.0 as mutable more than once at a time". It would be nice not to be forced to insert random curly braces to convince the borrow checker that my code is correct.

Issue 2:
UPDATE: This example works now, but needs someone to add a test. See mentoring instructions below.

I'm trying to compile some examples using nonlexical lifetimes. To do so, I'm compiling rustc using the master branch, and the -Z nll compiler option.

rustc 1.24.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.24.0-dev
LLVM version: 4.0

By compiling "Problem case 4: mutating &mut references" from nll-rfc, I get some errors.

Program

struct List<T> {
value: T,
next: Option<Box<List<T>>>,
}

fn to_refs<T>(mut list: &mut List<T>) -> Vec<&mut T> {
let mut result = vec![];
loop {
result.push(&mut list.value);
if let Some(n) = list.next.as_mut() {
list = &mut n;
} else {
return result;
}
}
}

fn main() {
println!("Hello World!");
}

Output of `rustc -g -Zverbose -Znll nll-problem-case-4.rs`:

error[E0597]: `n` does not live long enough
--> nll-problem-case-4.rs:11:25
|
11 | list = &mut n;
| ^ does not live long enough
...
14 | }
| - borrowed value only lives until here
|
note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 6:1...
--> nll-problem-case-4.rs:6:1
|
6 | / fn to_refs<T>(mut list: &mut List<T>) -> Vec<&mut T> {
7 | | let mut result = vec![];
8 | | loop {
9 | | result.push(&mut list.value);
... |
15 | | }
16 | | }
| |_^

error[E0499]: cannot borrow `list.value` as mutable more than once at a time
--> nll-problem-case-4.rs:9:26
|
9 | result.push(&mut list.value);
| ^^^^^^^^^^ mutable borrow starts here in previous iteration of loop
...
16 | }
| - mutable borrow ends here

error[E0499]: cannot borrow `list.next` as mutable more than once at a time
--> nll-problem-case-4.rs:10:26
|
10 | if let Some(n) = list.next.as_mut() {
| ^^^^^^^^^ mutable borrow starts here in previous iteration of loop
...
16 | }
| - mutable borrow ends here

error[E0506]: cannot assign to `list` because it is borrowed
--> nll-problem-case-4.rs:11:13
|
9 | result.push(&mut list.value);
| ---------- borrow of `list` occurs here
10 | if let Some(n) = list.next.as_mut() {
11 | list = &mut n;
| ^^^^^^^^^^^^^ assignment to borrowed `list` occurs here

error: aborting due to 4 previous errors

My questions are:

Am I enabling correctly the experimental nll? What confuses me is that I compiled rustc with ./configure --enable-debug --enable-debuginfo, but I still don't see the debug!("mir_borrowck done"); message from the compiler.

Is "problem case 4" supposed to compile without errors in the future, when nll will be stable?
Issue 1:
so it appears that [9] is wrong, should be consistent with [7],[8]

In [1]: index = date_range('20130101',freq='2D',periods=6)

In [2]: df = DataFrame(np.arange(20).reshape(5,4),columns=list('ABCD'),index=index.take([0,1,2,3,4]))

In [3]: df.resample('2D',how='max')
Out[3]:
A B C D
2013-01-01 0 1 2 3
2013-01-03 4 5 6 7
2013-01-05 8 9 10 11
2013-01-07 12 13 14 15
2013-01-09 16 17 18 19

In [4]: df.groupby(pd.Grouper(level=0,freq='2D')).max()
Out[4]:
A B C D
2013-01-01 0 1 2 3
2013-01-03 4 5 6 7
2013-01-05 8 9 10 11
2013-01-07 12 13 14 15
2013-01-09 16 17 18 19

In [5]: df.groupby([pd.Grouper(level=0,freq='2D')]).max()
Out[5]:
A B C D
2013-01-01 0 1 2 3
2013-01-03 4 5 6 7
2013-01-05 8 9 10 11
2013-01-07 12 13 14 15
2013-01-09 16 17 18 19

In [6]:

In [6]: df = DataFrame(np.arange(20).reshape(5,4),columns=list('ABCD'),index=index.take([0,1,2,4,5]))

In [7]: df.resample('2D')
Out[7]:
A B C D
2013-01-01 0 1 2 3
2013-01-03 4 5 6 7
2013-01-05 8 9 10 11
2013-01-07 NaN NaN NaN NaN
2013-01-09 12 13 14 15
2013-01-11 16 17 18 19

In [8]: df.groupby(pd.Grouper(level=0,freq='2D')).max()
Out[8]:
A B C D
2013-01-01 0 1 2 3
2013-01-03 4 5 6 7
2013-01-05 8 9 10 11
2013-01-07 NaN NaN NaN NaN
2013-01-09 12 13 14 15
2013-01-11 16 17 18 19

In [9]: df.groupby([pd.Grouper(level=0,freq='2D')]).max()
Out[9]:
A B C D
2013-01-01 0 1 2 3
2013-01-03 4 5 6 7
2013-01-05 8 9 10 11
2013-01-09 12 13 14 15
2013-01-11 16 17 18 19

Issue 2:
Code Sample, a copy-pastable example if possible

data_frame.groupby(pd.TimeGrouper('D', convention='start', key=time_column)).count()
data_frame.groupby([pd.TimeGrouper('D', convention='start', key=time_column)]).count()

give below two different outputs

location price profit type
time
2017-07-23 1 1 1 1
2017-07-24 0 0 0 0
2017-07-25 1 1 1 1
2017-07-26 1 1 1 1
2017-07-27 3 3 3 3
2017-07-28 6 6 6 6

location price profit type
time
2017-07-23 1 1 1 1
2017-07-25 1 1 1 1
2017-07-26 1 1 1 1
2017-07-27 3 3 3 3
2017-07-28 6 6 6 6

Problem description

The origin data frame doesn't contain a record in 2017-07-24, you can see if I use time grouper with convention='start' lonely, the 2017-07-24 item has been filled, but if by group list, that item hasn't been filled

Output of pd.show_versions()

INSTALLED VERSIONS

commit: None

python: 2.7.10.final.0

python-bits: 64

OS: Darwin

OS-release: 16.7.0

machine: x86_64

processor: i386

byteorder: little

LC_ALL: None

LANG: None

LOCALE: None.None

pandas: 0.20.3

pytest: None

pip: 9.0.1

setuptools: 36.2.0

Cython: None

numpy: 1.13.1

scipy: 0.19.1

xarray: None

IPython: None

sphinx: None

patsy: None

dateutil: 2.6.1

pytz: 2017.2

blosc: None

bottleneck: None

tables: None

numexpr: None

feather: None

matplotlib: None

openpyxl: None

xlrd: None

xlwt: None

xlsxwriter: None

lxml: None

bs4: None

html5lib: 0.9999999

sqlalchemy: None

pymysql: None

psycopg2: None

jinja2: None

s3fs: None

pandas_gbq: None

pandas_datareader: None
Issue 1:
Hello. First I would like to say it is not a bug report, but rather an expression of my inability to find answers by myself.

IMPORTANT

I would like to see the set of correct settings that lowers memory consumption to minimum while retaining speed at a high enough level with using proxy/dropped requests and scale at around 1-10M pages and 1000-2000 requests/minute. Now it goes up to 4Gb (can be not correct)

NOT IMPORTANT

Is it possible to use the same cache db file while running two spiders with the same name? (I tried and half of scraped data has been lost. (not 100% sure but still))

Is it possible to automatically turn off windows embedded antivirus?(speed issue)

Is it possible to run one spider and fetch cache from 2 sets of previously created files?

I've tried to use a AUTOTHROTTLE_TARGET_CONCURRENCY but it is don't increase speed without increasing CONCURRENT_REQUESTS.

DEPTH_PRIORITY = -1

SCHEDULER_DISK_QUEUE = 'scrapy.squeues.PickleLifoDiskQueue'

SCHEDULER_MEMORY_QUEUE = 'scrapy.squeues.LifoMemoryQueue'

(will it have any effect without -s JOBDIR setting?)

RETRY_PRIORITY_ADJUST = 10

DUPEFILTER_CLASS = 'scrapy.dupefilters.BaseDupeFilter'

HTTPCACHE_ENABLED = True

It seems that httpcache and dedupfilter increases memory consumption. (even for a simple 1-2 depth site.) Is it true?

Should I just read the source?

Issue 2:
There are situations where websites return 200 responses but the content is not available due to bans or temporal issues which can be fixed by retrying requests.

There should be an easier way to retry requests inside spider callbacks, which should ideally reuse the code in Retry downloader middleware.

I see two approaches for this.

Introduce new exception called RetryRequest which can be raised inside a spider callback to indicate a retry. I personally prefer this but the implementation of this is a little untidy due to this bug #220

from scrapy.exceptions import RetryRequest

def parse(self, response):
if response.xpath('//title[text()="Content not found"]'):
raise RetryRequest('Missing content')

Introduce a new class RetryRequest which wraps a request that needs to be retried. A RetryRequest can be yielded from a spider callback to indicate a retry

from scrapy.http import RetryRequest

def parse(self, response):
if response.xpath('//title[text()="Content not found"]'):
yield RetryRequest(response.request, reason='Missing content')

Will be sending two PRs for the two approaches. Happy to hear about any other alternatives too.
Issue 1:
Original ticket http://projects.scipy.org/scipy/ticket/976 on 2009-07-16 by trac user senyai, assigned to unknown.

I've got python 2.5.4, scipy 0.7.1 under windows XP 32 with 2G ram. I get crash when running [http://www.arseniy.net/files/scipy_bug.py]

Issue 2:
Original ticket http://projects.scipy.org/scipy/ticket/905 on 2009-03-31 by trac user parejkoj, assigned to unknown.

I'm trying to run scipy.stats.mode (in scipy.stats.stats) on a 2-d ndarray, but it takes an extremely long time. The data is an image (astronomical data), with:

data.shape = (227,3104)

data.dtype = ('float32')

A quick-and-dirty mode function like this:

def mode(data):
counts = {}
for x in data.flatten():
counts[x] = counts.get(x,0) + 1
maxcount = max(counts.values())
modelist = []
for x in counts:
if counts[x] == maxcount:
modelist.append(x)
return modelist,maxcount
#...

takes only a second or so to run, while stats.mode(data) or stats.mode(data.flatten()) takes ~20 minutes, no matter how I set the axis parameter. Am I missing something, or shouldn't it be significantly faster?

I'm using scipy 0.6.0 from Fink on Mac OS X Leopard with python2.5, but there appear to be no changes to the mode function between 0.6.0 and the current svn.
Issue 1:
By default Bootstrap Modal caches data loaded from remote resource. In my case I have different links to show different content in the same modal instance.

<a class="btn btn-success pull-right" href="/feedback" data-target="#modalFeedback" data-toggle="modal">Write review</a>
<a class="btn btn-success pull-right" href="/feedback?subject=order" data-target="#modalFeedback" data-toggle="modal">Order</a>

As you can see - I have two different addresses. But in Modal I see only first loaded page. All other clicks show me the same "old" content.

I solve this problem in this way:

// no cache data loaded to modal popup (by default it's cached)
$('body').on('hidden.bs.modal', '.modal', function (event) {
$(this).removeData('bs.modal');
});

I think that it will be better if you will add option cache (true/false) to Modal to control caching. It's not big change, but very helpful.

Issue 2:
This is for tracking #12296, in case the PR's author is unable to follow up.
Issue 1:
I'm submitting a bug/feature request (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[x] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Have a look at that, (demo: http://plnkr.co/edit/P25dYPC5ChRxpyxpL0Lj?p=preview):

@Component({
selector: 'my-app',
providers: [],
template: `
<div [formGroup]="form">
<input formControlName="first" [disabled]="isDisabled">
</div>
`,
directives: []
})
export class App {
isDisabled = true
form = new FormGroup({
'first': new FormControl('Hello')
})
}

There is a warning message asking to refactor the code, but more importantly, the input is unfortunately not disabled. Refactoring the code to what is suggested is not helping either, i.e. doing this will not work, (demo: http://plnkr.co/edit/Gf7FGR42UXkBh6e75cm2?p=preview):

@Component({
selector: 'my-app',
providers: [],
template: `
<div [formGroup]="form">
<input formControlName="first">
</div>
`,
directives: []
})
export class App {
isDisabled = false
form = new FormGroup({
'first': new FormControl({value: 'hello', disabled: this.isDisabled})
})

constructor() {
setTimeout(() {
this.isDisabled = true
}, 10)
}
}

Expected/desired behavior

After the callback of the setTimeout is executed, the input should be disabled, but it is not.

Reproduction of the problem

Yes, please look here: http://plnkr.co/edit/P25dYPC5ChRxpyxpL0Lj?p=preview

What is the motivation / use case for changing the behavior?

To have the same behaviour, or similar one than in RC5. At least, we shall have a possibility, even if it's a breaking change, to set dynamically the disabled attribute. As of now, it does not seem possible anymore.

Please tell us about your environment:

Angular version: 2.0.0-rc.6

Browser: [ Chrome 52 ]

Language: [ TypeScript ]

Issue 2:
Some subtle bug

export class BaseComp {
@Input() val: any;
...
}

@Component(...)
export class Comp extends BaseComp {
//@Input() val: any;

//@Output() evt = new EventEmitter(); <----
//If uncomment this one, you have to uncomment also @Input ... line, overwise
// component wouldn't see `val` variable
...
ngOnInit() {
console.log("I see ya, all fine, but try uncomment @Output ", this.val);
}
}
Issue 1:
Challenge http://www.freecodecamp.com/challenges/waypoint-target-a-specific-child-of-an-element-using-jquery has an issue.

The instructions say to input $(".well :nth-child(2)").addClass("animated bounce"); or $(".target:nth-child(2)").addClass("animated bounce"); —and in fact, both work well—, but I doubt most beginners will gather this nuance from the text.

I believe an explanation is due on how the one with space searches for the second child inside, whereas the one without searches for the second sibling.

Issue 2:
Claim your responsive design web design certificate needs a little editing - two of the steps mention beginning and intermediate algorithm scripting.

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36.
Issue 1:
https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/logs/kubernetes-e2e-gke-staging-parallel/4611/

Failed: Horizontal pod autoscaling (scale resource: CPU) ReplicationController light Should scale from 2 pods to 1 pod using HPA version v1 {Kubernetes e2e suite}

/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/horizontal_pod_autoscaling.go:103
Expected error:
<*errors.errorString | 0xc208bbe3d0>: {
s: "Only 1 pods started out of 2",
}
Only 1 pods started out of 2
not to have occurred

Issue 2:
https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/logs/kubernetes-e2e-gke/11123/

Failed: [k8s.io] [HPA] Horizontal pod autoscaling (scale resource: CPU) [k8s.io] ReplicationController light Should scale from 1 pod to 2 pods {Kubernetes e2e suite}

/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/horizontal_pod_autoscaling.go:88
Expected error:
<*errors.errorString | 0xc820de4c80>: {
s: "Only 0 pods started out of 1",
}
Only 0 pods started out of 1
not to have occurred

Previous issues for this test: #27443 #27835
Issue 1:
System information (version)

OpenCV => 3.4.0

Operating System / Platform => Linux Ubuntu 16.04 X86 64 Bit

Compiler => gcc 5.4

Detailed description

Running BFmatcher with crossCheck enabled doesn't really cross check. According to the documentation (https://docs.opencv.org/trunk/d3/da1/classcv_1_1BFMatcher.html#ac6418c6f87e0e12a88979ea57980c020)

If crossCheck==true, then the knnMatch() method with k=1 will only return pairs (i,j) such that for i-th query descriptor the j-th descriptor in the matcher's collection is the nearest and vice versa, i.e. the BFMatcher will only return consistent pairs.

I read this as, if i is closest to j, then j is also closest to i. I.e. this is symmetrical. However, this does not seem to be the case with the implemented algorithm. Also, if we switch the collections, i.e. queryDescriptors and trainDescriptors, we get different results, which is unexpected.

Steps to reproduce

To illustrate the first part of the issue, try the following

import numpy
import cv2

sources = numpy.array([[1, 1, 0], [1, 1, 1]], dtype=numpy.uint8)
targets = numpy.array([[1, 1, 1], [0, 0, 0]], dtype=numpy.uint8)
for si, source in enumerate(sources):
for ti, target in enumerate(targets):
print('%d -> %d: %d' % (si, ti, cv2.norm(source, target, cv2.NORM_HAMMING)))

bf = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=True)
matches = bf.knnMatch(sources, targets, k=1)
print('-- crosscheck=True')
for match in matches:
if match:
print('%d -> %d: %f' % (match[0].queryIdx, match[0].trainIdx, match[0].distance))

bf_nocc = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=False)
matches_nocc = bf.knnMatch(sources, targets, k=1)
print('-- crosscheck=False')
for match in matches_nocc:
if match:
print('%d -> %d: %f' % (match[0].queryIdx, match[0].trainIdx, match[0].distance))

This outputs

0 -> 0: 1
0 -> 1: 2
1 -> 0: 0
1 -> 1: 3
-- crossCheck=True
0 -> 1: 2.000000 <= Unexpected
1 -> 0: 0.000000
-- crossCheck=False
0 -> 0: 1.000000
1 -> 0: 0.000000

Here, the 0 -> 1 match when crossCheck=True is unexpected since source 0 is closer to target 0.

Also, if we switch the sources and targets arrays, we get

0 -> 0: 1
0 -> 1: 0
1 -> 0: 2
1 -> 1: 3
-- crossCheck=True
0 -> 1: 0.000000
-- crossCheck=False
0 -> 1: 0.000000
1 -> 0: 2.000000

Which is correct for crossCheck=True (as well as for crossCheck=False which I don't expect to be symmetrical).

Unless I have misunderstood how cross check is supposed to work, this appears to me to be an issue with the current implementation (there has been no updates on this algorithm since 3.4.0 as far as I can see)

For C++ sample code, see http://answers.opencv.org/question/194661/bfmatcher-with-crosscheck-doesnt-crosscheck/

Issue 2:
I am trying to install opencv on my mac

cd ~/opencv mkdir release cd release cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local .. make

I get the following error,

ld: framework not found CoreImage clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: * [lib/libopencv_videoio.3.1.0.dylib] Error 1 make[1]: [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2 make: ** [all] Error 2
Issue 1:
I think this was just missed as part of the infix expansions, or is there a reason these don't allow for their setindex variant? Looks like a parser failure to me.

MWE:

julia> a = [1]
1-element Vector{Int64}:
1

julia> a[1] ⊽= 2
ERROR: syntax: unexpected "="
Stacktrace:
[1] top-level scope
@ none:1

julia> a[1] ⊼= 2
ERROR: syntax: unexpected "="
Stacktrace:
[1] top-level scope
@ none:1

Issue 2:
@andreasnoack mentioned this on Slack:

julia> (Complex{T} where T) <: Complex
false

The annoying part is that in Complex, the upper bound for the TypVar is Real, but in Complex{T} where T, the upper bound is simply Any. But since it's not possible to instantiate e.g. Complex{String}:

julia> Complex{String}
ERROR: TypeError: in Complex, in T, expected T<:Real, got Type{String}
Stacktrace:
[1] top-level scope at REPL[17]:1

Then the extent of the two types Complex{T} where {T <: Any} is the same as Complex{T} where {T <: Real}. So Julia might as well normalise it to Complex{T} where {T <: Real}. Similarly for e.g. Complex{<:Number}.
Issue 1:
I think when setting suggest_mode to be missing, no suggestion should be returned if the term exists in the index. But it turns out not to behave like my expectation. Is it a bug or anything?

Below is what i did. (with elasticsearch 1.5)

# remove all
$ curl -XDELETE elastic:9200/*
{"acknowledged":true}

# index two documents
$ curl -XPOST elastic:9200/my_index/my_type -d '{"name": "shinagawa hotel"}'
{"_index":"my_index","_type":"my_type","_id":"AU4FdpnwDWV1B-oz3tLK","_version":1,"created":true}
$ curl -XPOST elastic:9200/my_index/my_type -d '{"name": "shirakawa hotel"}'
{"_index":"my_index","_type":"my_type","_id":"AU4Fdta7DWV1B-oz3tLL","_version":1,"created":true}

$ cat search.json

{
"explain": true,
"query": {
"match": {
"name": {
"query": "shinagawa"
}
}
},
"suggest": {
"my-suggest": {
"text": "shinagawa",
"term": {
"field": "name",
"suggest_mode": "missing"
}
}
}
}

$ curl elastic:9200/my_index/_search?pretty -d@search.json

{
"took" : 7,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 0.19178301,
"hits" : [ {
"_shard" : 3,
"_node" : "7UoDQJWRQYqF4Gjq94LiMg",
"_index" : "my_index",
"_type" : "my_type",
"_id" : "AU4FdpnwDWV1B-oz3tLK",
"_score" : 0.19178301,
"_source":{"name": "shinagawa hotel"},
"_explanation" : {
"value" : 0.19178301,
"description" : "weight(name:shinagawa in 0) [PerFieldSimilarity], result of:",
"details" : [ {
"value" : 0.19178301,
"description" : "fieldWeight in 0, product of:",
"details" : [ {
"value" : 1.0,
"description" : "tf(freq=1.0), with freq of:",
"details" : [ {
"value" : 1.0,
"description" : "termFreq=1.0"
} ]
}, {
"value" : 0.30685282,
"description" : "idf(docFreq=1, maxDocs=1)"
}, {
"value" : 0.625,
"description" : "fieldNorm(doc=0)"
} ]
} ]
}
} ]
},
"suggest" : {
"my-suggest" : [ {
"text" : "shinagawa",
"offset" : 0,
"length" : 9,
"options" : [ {
"text" : "shirakawa",
"score" : 0.7777778,
"freq" : 1
} ]
} ]
}
}

Here shinagawa is in the index of name field, but suggestion to it is not excluded.

Issue 2:
I have found a few odd cases where the phrase suggester with suggest_mode: "missing" generates a suggestion even though the query returns results. I am querying across two indexes but the query term only exists in one of the indexes. I get the search results I expect, but I do not expect to get a suggestion.

I am trying to come up with a curl recreation but I haven't been able to reproduce it yet in a smaller corpus.

I believe what is happening is that the phrase suggestions are getting merged together in the same way the query results are merged together across multiple indexes. If I have query results from test_1 and no results from test_2, then I expect to see results from test_1. But if I have a suggestion from test_1 and no suggestion from test_2 (due to suggest_mode: "missing"), I do not expect to see a suggestion.
Issue 1:
Describe how to replicate the bug.

I'm doing the fairly standard thing of adding a g.user property on the appcontext in my app, but pylint is complaining with:

Assigning to attribute 'user' not defined in class slots (assigning-non-slot)

Ignoring the pylint warning makes mypy complain very loudly error:

"AppContext" has no attribute "user"

This can be reproduced using the docs https://flask.palletsprojects.com/en/2.0.x/appcontext/#storing-data, which tell the user to store the db on g using: g.db = connect_to_database().

If we're not supposed to be setting random properties there any more then the docs probably need fixing. maybe we're supposed to use db = g.setdefault("db", connect_to_database()) now?

Python version: 2.0.0

Flask version: 3.9.4

Issue 2:
Thanks for a recent release of flask which looks great. 🎉 Just started testing it out.

This is not directly a bug afaik, but our CI started failing on the new release of flask and werkzeug.

Following the flask documentation, it appears the recommended way of setting new attributes to flask.g is simply doing flask.g.some_attribute = some_value.

This example code

from flask import g

g.some_attribute = 42

gives no pylint warning when used together with pip install "flask<2" "werkzeug<2", however after pip install --upgrade flask werkzeug the same code gives the following pylint warning:

test_pylint.py:3:0: E0237: Assigning to attribute 'some_attribute' not defined in class slots (assigning-non-slot)

Any recommended code change that should be done related to setting attributes on the namespace object flask.g, or would the best recommendation be to silence pylint when used with newest flask + werkzeug?